Create a new gnc embedded window plugin.
323 GncEmbeddedWindow *window;
325 GError *error = NULL;
328 ENTER(
"group %s, first %p, num %d, ui file %s, parent %p, add accelerators %d, user data %p",
329 action_group_name, action_entries, n_action_entries, ui_filename,
330 enclosing_win, add_accelerators, user_data);
332 window = g_object_new (GNC_TYPE_EMBEDDED_WINDOW, NULL);
334 builder = gtk_builder_new ();
335 gtk_builder_set_translation_domain (builder, PROJECT_NAME);
337 ui_fullname = g_strconcat (GNUCASH_RESOURCE_PREFIX
"/", ui_filename, NULL);
339 gtk_builder_add_from_resource (builder, ui_fullname, &error);
343 g_critical (
"Failed to load, Error %s", error->message);
344 g_error_free (error);
348 window->menubar_model = (GMenuModel *)gtk_builder_get_object (builder,
"embeddedwin-menu");
350 window->menubar = gtk_menu_bar_new_from_model (window->menubar_model);
351 gtk_container_add (GTK_CONTAINER(window->menu_dock), window->menubar);
352 gtk_widget_show (GTK_WIDGET(window->menubar));
354 window->toolbar = (GtkWidget *)gtk_builder_get_object (builder,
"embeddedwin-toolbar");
355 g_object_set (window->toolbar,
"toolbar-style", GTK_TOOLBAR_BOTH, NULL);
356 gtk_container_add (GTK_CONTAINER(window->menu_dock), GTK_WIDGET(window->toolbar));
357 gtk_widget_show (GTK_WIDGET(window->toolbar));
359 g_object_unref (builder);
361 window->simple_action_group = g_simple_action_group_new ();
363 g_action_map_add_action_entries (G_ACTION_MAP(window->simple_action_group),
368 gtk_widget_insert_action_group (GTK_WIDGET(window),
"embeddedwin",
369 G_ACTION_GROUP(window->simple_action_group));
371 window->parent_window = enclosing_win;
374 window->accel_group = gtk_accel_group_new ();
375 gtk_window_add_accel_group (GTK_WINDOW(enclosing_win), window->accel_group);
378 g_free (ui_fullname);
379 LEAVE(
"window %p", window);
#define ENTER(format, args...)
Print a function entry debugging message.
void gnc_add_accelerator_keys_for_menu(GtkWidget *menu, GMenuModel *model, GtkAccelGroup *accel_group)
Add accelerator keys for menu item widgets.
#define LEAVE(format, args...)
Print a function exit debugging message.