1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
# include "appFrameConfig.h"
# include <stdlib.h>
# include <stdio.h>
# include <appDebugon.h>
# include "appFrame.h"
# include "appSystem.h"
# include <appGeoString.h>
# ifdef USE_GTK
void appInspectorMakePageParent( AppInspector * ai )
{
GtkWidget * notebook;
notebook= gtk_notebook_new();
gtk_notebook_set_show_tabs( GTK_NOTEBOOK( notebook ), FALSE );
gtk_notebook_set_show_border( GTK_NOTEBOOK( notebook ), FALSE );
gtk_widget_show( notebook );
gtk_box_pack_start( GTK_BOX( ai->aiPaned ), notebook, FALSE, TRUE, 0 );
ai->aiPageParent= notebook;
return;
}
void appInspectorChoosePage( AppInspector * ai,
int andMenu,
int pageNumber )
{
gtk_notebook_set_page( GTK_NOTEBOOK( ai->aiPageParent ), pageNumber );
if ( andMenu )
{ appSetOptionmenu( &(ai->aiSubjectOptionmenu), pageNumber ); }
return;
}
static void appInspectorPageChosen( APP_WIDGET w,
void * vai,
void * call_data )
{
AppInspector * ai= (AppInspector *)vai;
int n;
const int andMenu= 0;
for ( n= 0; n < ai->aiSubjectCount; n++ )
{
if ( w == ai->aiSubjects[n].isMenuitem )
{ break; }
}
if ( n >= ai->aiSubjectCount )
{ LDEB(ai->aiSubjectCount); return; }
appInspectorChoosePage( ai, andMenu, n );
ai->aiCurrentSubject= n;
return;
}
void appMakeVerticalInspectorPage( APP_WIDGET * pPage,
APP_WIDGET * pMenuitem,
AppInspector * ai,
const char * label )
{
GtkWidget * item;
GtkWidget * page;
page= gtk_vbox_new( FALSE, COLUMN_SPACING_GTK );
gtk_notebook_append_page( GTK_NOTEBOOK( ai->aiPageParent ),
page, (GtkWidget *)0 );
gtk_widget_show( page );
item= appAddItemToOptionmenu( &(ai->aiSubjectOptionmenu), label,
appInspectorPageChosen, (void *)ai );
*pPage= page; *pMenuitem= item; return;
}
void appInspectorEnablePage( AppInspector * ai,
int pageNumber,
int enabled )
{
GtkWidget * page;
page= gtk_notebook_get_nth_page( GTK_NOTEBOOK( ai->aiPageParent ),
pageNumber );
gtk_widget_set_sensitive( page, enabled != 0 );
gtk_widget_set_sensitive( ai->aiSubjects[pageNumber].isMenuitem,
enabled != 0 );
return;
}
# endif /* USE_GTK */
|