[balsa/wip/gtk4] main-window: gtk_application_set_menubar() works
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/wip/gtk4] main-window: gtk_application_set_menubar() works
- Date: Mon, 22 Apr 2019 15:10:34 +0000 (UTC)
commit 8ace6eff6b3663b97acf328b3c58c20df2b92375
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Mon Apr 22 11:07:10 2019 -0400
main-window: gtk_application_set_menubar() works
src/main-window.c | 23 ++---------------------
1 file changed, 2 insertions(+), 21 deletions(-)
---
diff --git a/src/main-window.c b/src/main-window.c
index 8f2d1df6a..29800110c 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -2082,8 +2082,6 @@ balsa_window_add_action_entries(GActionMap * action_map)
static void
bw_set_menus(BalsaWindow * window)
{
- GtkApplication *application = gtk_window_get_application(GTK_WINDOW(window));
- BalsaWindowPrivate *priv = balsa_window_get_instance_private(window);
GtkBuilder *builder;
static const gchar resource_path[] =
"/org/desktop/Balsa/main-window.ui";
@@ -2093,28 +2091,11 @@ bw_set_menus(BalsaWindow * window)
builder = gtk_builder_new();
if (gtk_builder_add_from_resource(builder, resource_path, &err)) {
- GtkWidget *menubar;
-#ifdef SET_MENUBAR_SETS_A_VISIBLE_MENUBAR
+ GtkApplication *application = gtk_window_get_application(GTK_WINDOW(window));
+
gtk_application_set_menubar(application,
G_MENU_MODEL(gtk_builder_get_object
(builder, "menubar")));
-#else /* SET_MENUBAR_SETS_A_VISIBLE_MENUBAR */
- menubar = libbalsa_window_get_menu_bar(GTK_APPLICATION_WINDOW(window),
- win_entries,
- G_N_ELEMENTS(win_entries),
- resource_path, &err, window);
- if (err) {
- g_print("%s %s\n", __func__, err->message);
- g_error_free(err);
- } else {
-#if HAVE_MACOSX_DESKTOP
- libbalsa_macosx_menu(window, GTK_MENU_SHELL(menubar));
-#else
- gtk_container_add(GTK_CONTAINER(priv->vbox), menubar);
-#endif
- }
-#endif /* SET_MENUBAR_SETS_A_VISIBLE_MENUBAR */
-
} else {
g_print("%s error: %s\n", __func__, err->message);
balsa_information(LIBBALSA_INFORMATION_WARNING,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]