gtk_window_present(GTK_WINDOW(prefswindow));
}
+void
+on_toolbar_toggled(GtkToggleAction *action, ChimaraGlk *glk)
+{
+ extern GtkWidget *toolbar;
+
+ if(gtk_toggle_action_get_active(action))
+ gtk_widget_show(toolbar);
+ else
+ gtk_widget_hide(toolbar);
+}
+
void
on_undo_activate(GtkAction *action, ChimaraGlk *glk)
{
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkActionGroup" id="actiongroup">
+ <child>
+ <object class="GtkToggleAction" id="toolbar">
+ <property name="label" translatable="yes">_Toolbar</property>
+ <property name="tooltip" translatable="yes">Show a toolbar at the top of the window</property>
+ <signal name="toggled" handler="on_toolbar_toggled" swapped="no"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="view">
+ <property name="label" translatable="yes">_View</property>
+ </object>
+ </child>
<child>
<object class="GtkAction" id="about">
<property name="label">_About...</property>
GtkBuilder *builder = NULL;
GtkWidget *aboutwindow = NULL;
GtkWidget *prefswindow = NULL;
+GtkWidget *toolbar = NULL;
GObject *
load_object(const gchar *name)
aboutwindow = GTK_WIDGET(load_object("aboutwindow"));
prefswindow = GTK_WIDGET(load_object("prefswindow"));
GtkActionGroup *actiongroup = GTK_ACTION_GROUP(load_object("actiongroup"));
+ GtkToggleAction *toolbar_action = GTK_TOGGLE_ACTION(load_object("toolbar"));
const gchar **ptr;
GtkRecentFilter *filter = gtk_recent_filter_new();
gtk_ui_manager_insert_action_group(uimanager, actiongroup, 0);
GtkWidget *menubar = gtk_ui_manager_get_widget(uimanager, "/menubar");
- //GtkWidget *toolbar = gtk_ui_manager_get_widget(uimanager, "/toolbar");
+ toolbar = gtk_ui_manager_get_widget(uimanager, "/toolbar");
+ gtk_widget_set_no_show_all(toolbar, TRUE);
+ if(gtk_toggle_action_get_active(toolbar_action))
+ gtk_widget_show(toolbar);
+ else
+ gtk_widget_hide(toolbar);
gtk_box_pack_end(vbox, glk, TRUE, TRUE, 0);
gtk_box_pack_start(vbox, menubar, FALSE, FALSE, 0);
- //gtk_box_pack_start(vbox, toolbar, FALSE, FALSE, 0);
+ gtk_box_pack_start(vbox, toolbar, FALSE, FALSE, 0);
gtk_builder_connect_signals(builder, glk);
g_signal_connect(glk, "notify::program-name", G_CALLBACK(change_window_title), window);