diff --git a/src/objects/window/application.ui b/src/objects/window/application.ui deleted file mode 100644 index dcad96e..0000000 --- a/src/objects/window/application.ui +++ /dev/null @@ -1,23 +0,0 @@ - - - - -
- - About - app.about - - - Help - app.help - F1 - - - Quit - app.quit - <Primary>q - -
-
-
- diff --git a/src/objects/window/application.xml b/src/objects/window/application.xml new file mode 100644 index 0000000..5310c44 --- /dev/null +++ b/src/objects/window/application.xml @@ -0,0 +1,53 @@ + + + + +
+ + About PW3270 + app.about + + + Preferences + app.help + + + Quit + app.quit + +
+
+ + + + _Edit +
+ + _Copy + app.quit + + + _Paste + app.quit + +
+
+ + Plugins + app.quit + +
+
+ + + _View +
+ + _Fullscreen + app.quit + +
+
+ +
+
diff --git a/src/objects/window/init.c b/src/objects/window/init.c index fd00a73..e5236bc 100644 --- a/src/objects/window/init.c +++ b/src/objects/window/init.c @@ -50,8 +50,8 @@ gtk_box_pack_start(vBox,GTK_WIDGET(widget->toolbar),FALSE,TRUE,0); gtk_box_pack_start(vBox,GTK_WIDGET(widget->notebook),TRUE,TRUE,0); + gtk_widget_show_all(GTK_WIDGET(vBox)); gtk_container_add(GTK_CONTAINER(widget),GTK_WIDGET(vBox)); - gtk_widget_show_all(GTK_WIDGET(widget)); } diff --git a/src/objects/window/terminal.c b/src/objects/window/terminal.c index adb4a4d..8138534 100644 --- a/src/objects/window/terminal.c +++ b/src/objects/window/terminal.c @@ -72,6 +72,9 @@ g_signal_connect(G_OBJECT(terminal), "focus-in-event", G_CALLBACK(on_terminal_focus), widget); g_signal_connect(G_OBJECT(terminal), "session_changed", G_CALLBACK(session_changed),label); + gtk_widget_show_all(terminal); + gtk_widget_show_all(label); + gtk_notebook_append_page(GTK_NOTEBOOK(window->notebook),terminal,label); gtk_notebook_set_show_tabs(GTK_NOTEBOOK(window->notebook),gtk_notebook_get_n_pages(GTK_NOTEBOOK(window->notebook)) > 1); diff --git a/src/objects/window/testprogram/testprogram.c b/src/objects/window/testprogram/testprogram.c index e8575de..871eb96 100644 --- a/src/objects/window/testprogram/testprogram.c +++ b/src/objects/window/testprogram/testprogram.c @@ -41,6 +41,8 @@ GtkWidget * window = pw3270_application_window_new(app); + gtk_application_window_set_show_menubar(GTK_APPLICATION_WINDOW(window),TRUE); + // Create terminal widget pw3270_terminal_new(window); pw3270_terminal_new(window); @@ -48,7 +50,9 @@ // Setup and show main window gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_CENTER); gtk_window_set_default_size (GTK_WINDOW (window), 800, 500); - gtk_widget_show_all(window); + + // gtk_widget_show_all(window); + gtk_window_present(GTK_WINDOW(window)); } @@ -85,7 +89,7 @@ GtkWidget * pw3270_toolbar_new(void) { return toolbar; } -static void preferences_activated(GSimpleAction * action, GtkApplication *application) { +static void preferences_activated(GSimpleAction * action, GVariant *parameter, gpointer application) { debug("%s",__FUNCTION__); @@ -97,7 +101,7 @@ static void quit_activated(GSimpleAction * action, GVariant *parameter, gpointer } -void startup(GtkApplication *application, gpointer user_data) { +void startup(GtkApplication *app) { static GActionEntry app_entries[] = { { @@ -131,32 +135,30 @@ void startup(GtkApplication *application, gpointer user_data) { }; g_action_map_add_action_entries( - G_ACTION_MAP(application), + G_ACTION_MAP(app), app_entries, G_N_ELEMENTS(app_entries), - application + app ); - GtkBuilder * builder = gtk_builder_new_from_file("application.ui"); + GtkBuilder * builder = gtk_builder_new_from_file("application.xml"); debug("Builder: %p",builder); - GMenuModel * app_menu = G_MENU_MODEL(gtk_builder_get_object(builder, "app-menu")); - debug("app-menu: %p", app_menu); - gtk_application_set_app_menu(application, app_menu); - - - // gtk_application_set_menubar(application, G_MENU_MODEL(gtk_builder_get_object(builder, "app-menubar"))); + gtk_application_set_app_menu(GTK_APPLICATION (app), G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu"))); + gtk_application_set_menubar(GTK_APPLICATION (app), G_MENU_MODEL (gtk_builder_get_object (builder, "menubar"))); g_object_unref(builder); + } + int main (int argc, char **argv) { GtkApplication *app; int status; - app = gtk_application_new ("br.com.bb.pw3270",G_APPLICATION_FLAGS_NONE); + app = gtk_application_new("br.com.bb.pw3270",G_APPLICATION_HANDLES_OPEN); g_signal_connect (app, "activate", G_CALLBACK(activate), NULL); g_signal_connect (app, "startup", G_CALLBACK(startup), NULL); -- libgit2 0.21.2