static int hide_hidden_panes( void ) { debugger_pane i; GtkCheckMenuItem *checkitem; GtkWidget *pane; for( i = DEBUGGER_PANE_BEGIN; i < DEBUGGER_PANE_END; i++ ) { checkitem = get_pane_menu_item( i ); if( !checkitem ) return 1; if( gtk_check_menu_item_get_active( checkitem ) ) continue; pane = get_pane( i ); if( !pane ) return 1; gtk_widget_hide( pane ); } return 0; }
static int create_dialog( void ) { int error; GtkWidget *hbox, *vbox, *hbox2; GtkAccelGroup *accel_group; debugger_pane i; gtkui_font font; error = gtkui_get_monospaced_font( &font ); if( error ) return error; dialog = gtkstock_dialog_new( "Fuse - Debugger", GTK_SIGNAL_FUNC( delete_dialog ) ); /* Keyboard shortcuts */ accel_group = gtk_accel_group_new(); gtk_window_add_accel_group( GTK_WINDOW( dialog ), accel_group ); /* The menu bar */ error = create_menu_bar( GTK_BOX( GTK_DIALOG( dialog )->vbox ), accel_group ); if( error ) return error; /* Some boxes to contain the things we want to display */ hbox = gtk_hbox_new( FALSE, 0 ); gtk_box_pack_start( GTK_BOX( GTK_DIALOG( dialog )->vbox ), hbox, TRUE, TRUE, 5 ); vbox = gtk_vbox_new( FALSE, 5 ); gtk_box_pack_start( GTK_BOX( hbox ), vbox, TRUE, TRUE, 5 ); hbox2 = gtk_hbox_new( FALSE, 5 ); gtk_box_pack_start_defaults( GTK_BOX( vbox ), hbox2 ); /* The main display areas */ error = create_register_display( GTK_BOX( hbox2 ), font ); if( error ) return error; error = create_memory_map( GTK_BOX( hbox2 ) ); if( error ) return error; error = create_breakpoints( GTK_BOX( vbox ) ); if( error ) return error; error = create_disassembly( GTK_BOX( hbox ), font ); if( error ) return error; error = create_stack_display( GTK_BOX( hbox ), font ); if( error ) return error; error = create_events( GTK_BOX( hbox ) ); if( error ) return error; error = create_command_entry( GTK_BOX( GTK_DIALOG( dialog )->vbox ), accel_group ); if( error ) return error; /* The action buttons */ error = create_buttons( GTK_DIALOG( dialog ), accel_group ); if( error ) return error; /* Initially, have all the panes visible */ for( i = DEBUGGER_PANE_BEGIN; i < DEBUGGER_PANE_END; i++ ) { GtkCheckMenuItem *check_item; check_item = get_pane_menu_item( i ); if( !check_item ) break; gtk_check_menu_item_set_active( check_item, TRUE ); } gtkui_free_font( font ); dialog_created = 1; return 0; }