void main ( int argc, char **argv ) { Widget shell, text; XtAppContext app; /* * Initialize Xt */ shell = XtAppInitialize ( &app, "Inputtest", NULL, 0, &argc, argv, NULL, NULL, 0 ); /* * Create an input field and register a callback to * be called when the user types a <Return> key */ text = CreateInputField ( shell ); XtAddCallback ( text, XmNactivateCallback, EnterCallback, NULL); /* * Realize the shell and enter the event loop. */ XtRealizeWidget ( shell ); XtAppMainLoop ( app ); }
CLuaCFGMenu::CLuaCFGMenu(const char *desc) : CBaseLuaWidget(desc), m_bInitSelection(true) { GtkWidget *vbox = gtk_vbox_new(FALSE, 10); gtk_widget_show(vbox); gtk_container_add(GTK_CONTAINER(GetBox()), vbox); GtkWidget *varbox = CreateVarListBox(); gtk_container_add(GTK_CONTAINER(vbox), varbox); m_pInputField = CreateInputField(); gtk_box_pack_start(GTK_BOX(vbox), m_pInputField, TRUE, TRUE, 10); m_pComboBox = CreateComboBox(); gtk_box_pack_start(GTK_BOX(vbox), m_pComboBox, TRUE, TRUE, 10); m_pDirInputBox = CreateDirSelector(); gtk_box_pack_start(GTK_BOX(vbox), m_pDirInputBox, TRUE, TRUE, 10); }