2003-11-15 20:35:55 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2003-08-24 19:58:30 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
2003-11-15 20:35:55 +00:00
|
|
|
#ifdef HAVE_UNISTD_H
|
2003-09-17 23:58:28 +00:00
|
|
|
#include <unistd.h>
|
2003-11-15 20:35:55 +00:00
|
|
|
#endif
|
2003-08-24 19:58:30 +00:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2003-11-15 20:35:55 +00:00
|
|
|
#ifndef STDOUT_FILENO
|
|
|
|
#define STDOUT_FILENO 1
|
|
|
|
#endif
|
|
|
|
|
2003-08-24 19:58:30 +00:00
|
|
|
struct { const gchar *filename; guint merge_id; } merge_ids[] = {
|
|
|
|
{ "merge-1.ui", 0 },
|
|
|
|
{ "merge-2.ui", 0 },
|
|
|
|
{ "merge-3.ui", 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
dump_tree (GtkWidget *button,
|
2003-08-25 23:13:47 +00:00
|
|
|
GtkUIManager *merge)
|
2003-08-24 19:58:30 +00:00
|
|
|
{
|
|
|
|
gchar *dump;
|
|
|
|
|
2003-08-25 23:13:47 +00:00
|
|
|
dump = gtk_ui_manager_get_ui (merge);
|
2003-08-24 19:58:30 +00:00
|
|
|
g_message (dump);
|
|
|
|
g_free (dump);
|
|
|
|
}
|
|
|
|
|
2003-09-17 23:58:28 +00:00
|
|
|
static void
|
|
|
|
dump_accels (void)
|
|
|
|
{
|
|
|
|
gtk_accel_map_save_fd (STDOUT_FILENO);
|
|
|
|
}
|
|
|
|
|
2004-01-08 23:37:34 +00:00
|
|
|
static void
|
|
|
|
print_toplevel (GtkWidget *widget, gpointer user_data)
|
|
|
|
{
|
|
|
|
g_print ("%s\n", G_OBJECT_TYPE_NAME (widget));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dump_toplevels (GtkWidget *button,
|
|
|
|
GtkUIManager *merge)
|
|
|
|
{
|
|
|
|
GSList *toplevels;
|
|
|
|
|
|
|
|
toplevels = gtk_ui_manager_get_toplevels (merge,
|
|
|
|
GTK_UI_MANAGER_MENUBAR |
|
|
|
|
GTK_UI_MANAGER_TOOLBAR |
|
|
|
|
GTK_UI_MANAGER_POPUP);
|
|
|
|
|
2004-01-12 22:45:45 +00:00
|
|
|
g_slist_foreach (toplevels, (GFunc)print_toplevel, NULL);
|
2004-01-08 23:37:34 +00:00
|
|
|
g_slist_free (toplevels);
|
|
|
|
}
|
|
|
|
|
2003-08-29 22:42:37 +00:00
|
|
|
static void
|
|
|
|
toggle_tearoffs (GtkWidget *button,
|
|
|
|
GtkUIManager *merge)
|
|
|
|
{
|
|
|
|
gboolean add_tearoffs;
|
|
|
|
|
|
|
|
add_tearoffs = gtk_ui_manager_get_add_tearoffs (merge);
|
|
|
|
|
|
|
|
gtk_ui_manager_set_add_tearoffs (merge, !add_tearoffs);
|
|
|
|
}
|
|
|
|
|
2003-09-04 20:39:15 +00:00
|
|
|
static void
|
|
|
|
toggle_dynamic (GtkWidget *button,
|
|
|
|
GtkUIManager *merge)
|
|
|
|
{
|
|
|
|
GtkAction *dyn;
|
|
|
|
static GtkActionGroup *dynamic = NULL;
|
|
|
|
static guint merge_id = 0;
|
|
|
|
|
|
|
|
if (!dynamic)
|
|
|
|
{
|
|
|
|
dynamic = gtk_action_group_new ("dynamic");
|
|
|
|
gtk_ui_manager_insert_action_group (merge, dynamic, 0);
|
|
|
|
dyn = g_object_new (GTK_TYPE_ACTION,
|
|
|
|
"name", "dyn1",
|
|
|
|
"label", "Dynamic action 1",
|
|
|
|
"stock_id", GTK_STOCK_COPY,
|
|
|
|
NULL);
|
|
|
|
gtk_action_group_add_action (dynamic, dyn);
|
|
|
|
dyn = g_object_new (GTK_TYPE_ACTION,
|
|
|
|
"name", "dyn2",
|
|
|
|
"label", "Dynamic action 2",
|
|
|
|
"stock_id", GTK_STOCK_EXECUTE,
|
|
|
|
NULL);
|
|
|
|
gtk_action_group_add_action (dynamic, dyn);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (merge_id == 0)
|
|
|
|
{
|
|
|
|
merge_id = gtk_ui_manager_new_merge_id (merge);
|
|
|
|
gtk_ui_manager_add_ui (merge, merge_id, "/toolbar1/ToolbarPlaceholder",
|
|
|
|
"dyn1", "dyn1", 0, 0);
|
|
|
|
gtk_ui_manager_add_ui (merge, merge_id, "/toolbar1/ToolbarPlaceholder",
|
|
|
|
"dynsep", NULL, GTK_UI_MANAGER_SEPARATOR, 0);
|
|
|
|
gtk_ui_manager_add_ui (merge, merge_id, "/toolbar1/ToolbarPlaceholder",
|
|
|
|
"dyn2", "dyn2", 0, 0);
|
|
|
|
|
|
|
|
gtk_ui_manager_add_ui (merge, merge_id, "/menubar/EditMenu",
|
|
|
|
"dyn1menu", "dyn1", GTK_UI_MANAGER_MENU, 0);
|
|
|
|
gtk_ui_manager_add_ui (merge, merge_id, "/menubar/EditMenu/dyn1menu",
|
|
|
|
"dyn1", "dyn1", GTK_UI_MANAGER_MENUITEM, 0);
|
|
|
|
gtk_ui_manager_add_ui (merge, merge_id, "/menubar/EditMenu/dyn1menu",
|
|
|
|
"dyn2", "dyn2", GTK_UI_MANAGER_AUTO, TRUE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_ui_manager_remove_ui (merge, merge_id);
|
|
|
|
merge_id = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-08-24 19:58:30 +00:00
|
|
|
static void
|
|
|
|
activate_action (GtkAction *action)
|
|
|
|
{
|
|
|
|
const gchar *name = gtk_action_get_name (action);
|
|
|
|
const gchar *typename = G_OBJECT_TYPE_NAME (action);
|
|
|
|
|
|
|
|
g_message ("Action %s (type=%s) activated", name, typename);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
toggle_action (GtkAction *action)
|
|
|
|
{
|
|
|
|
const gchar *name = gtk_action_get_name (action);
|
|
|
|
const gchar *typename = G_OBJECT_TYPE_NAME (action);
|
|
|
|
|
2003-09-04 21:34:15 +00:00
|
|
|
g_message ("ToggleAction %s (type=%s) toggled (active=%d)", name, typename,
|
2003-08-24 19:58:30 +00:00
|
|
|
gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Change the XML format: <Root> element is replaced by <ui>, <menu> element
2003-08-28 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.c: Change the XML format:
<Root> element is replaced by <ui>,
<menu> element is replaced by <menubar>,
<submenu> element is replaced by <menu>,
<dockitem> element is replaced by <toolbar>,
<popups> element is gone,
verb attribute is replaced by action,
name defaults to action or the element name.
* gtk/gtkactiongroup.[hc]: Replace GtkActionGroupEntry by GtkActionEntry
and GtkRadioActionEntry. GtkActionEntry is simplified by removing
the user_data, entry_type and extra_data fields, GtkRadioActionEntry is
further simplified by removing the callback. The user_data can now be
specified as an argument to gtk_action_group_add_actions(). There is
a new method gtk_action_group_add_radio_actions(), which is similar
to gtk_action_group_add_actions(), but takes GtkRadioActionEntrys
and a callback parameter in addition to the user_data. The callback
is connected to the ::changed signal of the first group member.
There are _full() variants taking a GDestroyNotify of
gtk_action_group_add_[radio_]actions().
* gtk/gtkradioaction.[hc]: Add a ::changed signal which gets emitted
on every member of the radio group when the active member is changed.
Add an integer property "value", and a getter for the value of "value"
on the currently active group member.
* tests/testactions.c:
* tests/testmerge.c:
* tests/merge-[123].ui:
* demos/gtk-demo/appwindow.c: Adjust to these changes.
* gtk/gtktoolbar.c (gtk_toolbar_append_element): Trivial doc fix.
2003-08-27 22:22:28 +00:00
|
|
|
static void
|
|
|
|
radio_action_changed (GtkAction *action, GtkRadioAction *current)
|
|
|
|
{
|
2003-09-04 21:34:15 +00:00
|
|
|
g_message ("RadioAction %s (type=%s) activated (active=%d) (value %d)",
|
Change the XML format: <Root> element is replaced by <ui>, <menu> element
2003-08-28 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.c: Change the XML format:
<Root> element is replaced by <ui>,
<menu> element is replaced by <menubar>,
<submenu> element is replaced by <menu>,
<dockitem> element is replaced by <toolbar>,
<popups> element is gone,
verb attribute is replaced by action,
name defaults to action or the element name.
* gtk/gtkactiongroup.[hc]: Replace GtkActionGroupEntry by GtkActionEntry
and GtkRadioActionEntry. GtkActionEntry is simplified by removing
the user_data, entry_type and extra_data fields, GtkRadioActionEntry is
further simplified by removing the callback. The user_data can now be
specified as an argument to gtk_action_group_add_actions(). There is
a new method gtk_action_group_add_radio_actions(), which is similar
to gtk_action_group_add_actions(), but takes GtkRadioActionEntrys
and a callback parameter in addition to the user_data. The callback
is connected to the ::changed signal of the first group member.
There are _full() variants taking a GDestroyNotify of
gtk_action_group_add_[radio_]actions().
* gtk/gtkradioaction.[hc]: Add a ::changed signal which gets emitted
on every member of the radio group when the active member is changed.
Add an integer property "value", and a getter for the value of "value"
on the currently active group member.
* tests/testactions.c:
* tests/testmerge.c:
* tests/merge-[123].ui:
* demos/gtk-demo/appwindow.c: Adjust to these changes.
* gtk/gtktoolbar.c (gtk_toolbar_append_element): Trivial doc fix.
2003-08-27 22:22:28 +00:00
|
|
|
gtk_action_get_name (GTK_ACTION (current)),
|
|
|
|
G_OBJECT_TYPE_NAME (GTK_ACTION (current)),
|
|
|
|
gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (current)),
|
|
|
|
gtk_radio_action_get_current_value (current));
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkActionEntry entries[] = {
|
|
|
|
{ "FileMenuAction", NULL, "_File" },
|
|
|
|
{ "EditMenuAction", NULL, "_Edit" },
|
|
|
|
{ "HelpMenuAction", NULL, "_Help" },
|
|
|
|
{ "JustifyMenuAction", NULL, "_Justify" },
|
2003-09-30 20:55:24 +00:00
|
|
|
{ "EmptyMenu1Action", NULL, "Empty 1" },
|
|
|
|
{ "EmptyMenu2Action", NULL, "Empty 2" },
|
Change the XML format: <Root> element is replaced by <ui>, <menu> element
2003-08-28 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.c: Change the XML format:
<Root> element is replaced by <ui>,
<menu> element is replaced by <menubar>,
<submenu> element is replaced by <menu>,
<dockitem> element is replaced by <toolbar>,
<popups> element is gone,
verb attribute is replaced by action,
name defaults to action or the element name.
* gtk/gtkactiongroup.[hc]: Replace GtkActionGroupEntry by GtkActionEntry
and GtkRadioActionEntry. GtkActionEntry is simplified by removing
the user_data, entry_type and extra_data fields, GtkRadioActionEntry is
further simplified by removing the callback. The user_data can now be
specified as an argument to gtk_action_group_add_actions(). There is
a new method gtk_action_group_add_radio_actions(), which is similar
to gtk_action_group_add_actions(), but takes GtkRadioActionEntrys
and a callback parameter in addition to the user_data. The callback
is connected to the ::changed signal of the first group member.
There are _full() variants taking a GDestroyNotify of
gtk_action_group_add_[radio_]actions().
* gtk/gtkradioaction.[hc]: Add a ::changed signal which gets emitted
on every member of the radio group when the active member is changed.
Add an integer property "value", and a getter for the value of "value"
on the currently active group member.
* tests/testactions.c:
* tests/testmerge.c:
* tests/merge-[123].ui:
* demos/gtk-demo/appwindow.c: Adjust to these changes.
* gtk/gtktoolbar.c (gtk_toolbar_append_element): Trivial doc fix.
2003-08-27 22:22:28 +00:00
|
|
|
{ "Test", NULL, "Test" },
|
|
|
|
|
2003-09-26 23:01:32 +00:00
|
|
|
{ "QuitAction", GTK_STOCK_QUIT, NULL, "<control>q", "Quit", G_CALLBACK (gtk_main_quit) },
|
|
|
|
{ "NewAction", GTK_STOCK_NEW, NULL, "<control>n", "Create something", G_CALLBACK (activate_action) },
|
|
|
|
{ "New2Action", GTK_STOCK_NEW, NULL, "<control>m", "Create something else", G_CALLBACK (activate_action) },
|
2003-12-31 01:05:57 +00:00
|
|
|
{ "OpenAction", GTK_STOCK_OPEN, NULL, NULL, "Open it", G_CALLBACK (activate_action) },
|
2003-09-26 23:01:32 +00:00
|
|
|
{ "CutAction", GTK_STOCK_CUT, NULL, "<control>x", "Knive", G_CALLBACK (activate_action) },
|
|
|
|
{ "CopyAction", GTK_STOCK_COPY, NULL, "<control>c", "Copy", G_CALLBACK (activate_action) },
|
|
|
|
{ "PasteAction", GTK_STOCK_PASTE, NULL, "<control>v", "Paste", G_CALLBACK (activate_action) },
|
|
|
|
{ "AboutAction", NULL, "_About", NULL, "About", G_CALLBACK (activate_action) },
|
2003-08-24 19:58:30 +00:00
|
|
|
};
|
|
|
|
static guint n_entries = G_N_ELEMENTS (entries);
|
|
|
|
|
2003-09-15 19:51:55 +00:00
|
|
|
static GtkToggleActionEntry toggle_entries[] = {
|
2003-09-26 23:01:32 +00:00
|
|
|
{ "BoldAction", GTK_STOCK_BOLD, "_Bold", "<control>b", "Make it bold", G_CALLBACK (toggle_action),
|
2003-09-15 19:51:55 +00:00
|
|
|
TRUE },
|
|
|
|
};
|
|
|
|
static guint n_toggle_entries = G_N_ELEMENTS (toggle_entries);
|
|
|
|
|
Change the XML format: <Root> element is replaced by <ui>, <menu> element
2003-08-28 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.c: Change the XML format:
<Root> element is replaced by <ui>,
<menu> element is replaced by <menubar>,
<submenu> element is replaced by <menu>,
<dockitem> element is replaced by <toolbar>,
<popups> element is gone,
verb attribute is replaced by action,
name defaults to action or the element name.
* gtk/gtkactiongroup.[hc]: Replace GtkActionGroupEntry by GtkActionEntry
and GtkRadioActionEntry. GtkActionEntry is simplified by removing
the user_data, entry_type and extra_data fields, GtkRadioActionEntry is
further simplified by removing the callback. The user_data can now be
specified as an argument to gtk_action_group_add_actions(). There is
a new method gtk_action_group_add_radio_actions(), which is similar
to gtk_action_group_add_actions(), but takes GtkRadioActionEntrys
and a callback parameter in addition to the user_data. The callback
is connected to the ::changed signal of the first group member.
There are _full() variants taking a GDestroyNotify of
gtk_action_group_add_[radio_]actions().
* gtk/gtkradioaction.[hc]: Add a ::changed signal which gets emitted
on every member of the radio group when the active member is changed.
Add an integer property "value", and a getter for the value of "value"
on the currently active group member.
* tests/testactions.c:
* tests/testmerge.c:
* tests/merge-[123].ui:
* demos/gtk-demo/appwindow.c: Adjust to these changes.
* gtk/gtktoolbar.c (gtk_toolbar_append_element): Trivial doc fix.
2003-08-27 22:22:28 +00:00
|
|
|
enum {
|
|
|
|
JUSTIFY_LEFT,
|
|
|
|
JUSTIFY_CENTER,
|
|
|
|
JUSTIFY_RIGHT,
|
|
|
|
JUSTIFY_FILL
|
|
|
|
};
|
|
|
|
|
|
|
|
static GtkRadioActionEntry radio_entries[] = {
|
|
|
|
{ "justify-left", GTK_STOCK_JUSTIFY_LEFT, NULL, "<control>L",
|
|
|
|
"Left justify the text", JUSTIFY_LEFT },
|
|
|
|
{ "justify-center", GTK_STOCK_JUSTIFY_CENTER, NULL, "<control>E",
|
|
|
|
"Center justify the text", JUSTIFY_CENTER },
|
|
|
|
{ "justify-right", GTK_STOCK_JUSTIFY_RIGHT, NULL, "<control>R",
|
|
|
|
"Right justify the text", JUSTIFY_RIGHT },
|
|
|
|
{ "justify-fill", GTK_STOCK_JUSTIFY_FILL, NULL, "<control>J",
|
|
|
|
"Fill justify the text", JUSTIFY_FILL },
|
|
|
|
};
|
|
|
|
static guint n_radio_entries = G_N_ELEMENTS (radio_entries);
|
|
|
|
|
2003-08-24 19:58:30 +00:00
|
|
|
static void
|
2003-08-25 23:13:47 +00:00
|
|
|
add_widget (GtkUIManager *merge,
|
2003-08-24 19:58:30 +00:00
|
|
|
GtkWidget *widget,
|
|
|
|
GtkBox *box)
|
|
|
|
{
|
2003-08-29 23:23:44 +00:00
|
|
|
GtkWidget *handle_box;
|
|
|
|
|
|
|
|
if (GTK_IS_TOOLBAR (widget))
|
|
|
|
{
|
|
|
|
handle_box = gtk_handle_box_new ();
|
|
|
|
gtk_widget_show (handle_box);
|
|
|
|
gtk_container_add (GTK_CONTAINER (handle_box), widget);
|
|
|
|
gtk_box_pack_start (box, handle_box, FALSE, FALSE, 0);
|
2003-08-30 21:18:43 +00:00
|
|
|
g_signal_connect_swapped (widget, "destroy",
|
|
|
|
G_CALLBACK (gtk_widget_destroy), handle_box);
|
2003-08-29 23:23:44 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
gtk_box_pack_start (box, widget, FALSE, FALSE, 0);
|
|
|
|
|
2003-08-24 19:58:30 +00:00
|
|
|
gtk_widget_show (widget);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
toggle_merge (GtkWidget *button,
|
2003-08-25 23:13:47 +00:00
|
|
|
GtkUIManager *merge)
|
2003-08-24 19:58:30 +00:00
|
|
|
{
|
|
|
|
gint mergenum;
|
|
|
|
|
|
|
|
mergenum = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "mergenum"));
|
|
|
|
|
|
|
|
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
|
|
|
|
{
|
|
|
|
GError *err = NULL;
|
|
|
|
|
|
|
|
g_message ("merging %s", merge_ids[mergenum].filename);
|
|
|
|
merge_ids[mergenum].merge_id =
|
2003-08-25 23:13:47 +00:00
|
|
|
gtk_ui_manager_add_ui_from_file (merge, merge_ids[mergenum].filename, &err);
|
2003-08-24 19:58:30 +00:00
|
|
|
if (err != NULL)
|
|
|
|
{
|
|
|
|
GtkWidget *dialog;
|
|
|
|
|
|
|
|
dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (button)),
|
|
|
|
0, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK,
|
|
|
|
"could not merge %s: %s", merge_ids[mergenum].filename,
|
|
|
|
err->message);
|
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (dialog), "response", G_CALLBACK (gtk_object_destroy), NULL);
|
|
|
|
gtk_widget_show (dialog);
|
|
|
|
|
|
|
|
g_clear_error (&err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_message ("unmerging %s (merge_id=%u)", merge_ids[mergenum].filename,
|
|
|
|
merge_ids[mergenum].merge_id);
|
2003-08-25 23:13:47 +00:00
|
|
|
gtk_ui_manager_remove_ui (merge, merge_ids[mergenum].merge_id);
|
2003-08-24 19:58:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
set_name_func (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
GtkTreeModel *tree_model,
|
|
|
|
GtkTreeIter *iter,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GtkAction *action;
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
gtk_tree_model_get (tree_model, iter, 0, &action, -1);
|
|
|
|
g_object_get (G_OBJECT (action), "name", &name, NULL);
|
|
|
|
g_object_set (G_OBJECT (cell), "text", name, NULL);
|
|
|
|
g_free (name);
|
|
|
|
g_object_unref (action);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
set_sensitive_func (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
GtkTreeModel *tree_model,
|
|
|
|
GtkTreeIter *iter,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GtkAction *action;
|
|
|
|
gboolean sensitive;
|
|
|
|
|
|
|
|
gtk_tree_model_get (tree_model, iter, 0, &action, -1);
|
|
|
|
g_object_get (G_OBJECT (action), "sensitive", &sensitive, NULL);
|
|
|
|
g_object_set (G_OBJECT (cell), "active", sensitive, NULL);
|
|
|
|
g_object_unref (action);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
set_visible_func (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
GtkTreeModel *tree_model,
|
|
|
|
GtkTreeIter *iter,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GtkAction *action;
|
|
|
|
gboolean visible;
|
|
|
|
|
|
|
|
gtk_tree_model_get (tree_model, iter, 0, &action, -1);
|
|
|
|
g_object_get (G_OBJECT (action), "visible", &visible, NULL);
|
|
|
|
g_object_set (G_OBJECT (cell), "active", visible, NULL);
|
|
|
|
g_object_unref (action);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
sensitivity_toggled (GtkCellRendererToggle *cell,
|
|
|
|
const gchar *path_str,
|
|
|
|
GtkTreeModel *model)
|
|
|
|
{
|
|
|
|
GtkTreePath *path;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkAction *action;
|
|
|
|
gboolean sensitive;
|
|
|
|
|
|
|
|
path = gtk_tree_path_new_from_string (path_str);
|
|
|
|
gtk_tree_model_get_iter (model, &iter, path);
|
|
|
|
|
|
|
|
gtk_tree_model_get (model, &iter, 0, &action, -1);
|
|
|
|
g_object_get (G_OBJECT (action), "sensitive", &sensitive, NULL);
|
|
|
|
g_object_set (G_OBJECT (action), "sensitive", !sensitive, NULL);
|
|
|
|
gtk_tree_model_row_changed (model, path, &iter);
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
visibility_toggled (GtkCellRendererToggle *cell,
|
|
|
|
const gchar *path_str,
|
|
|
|
GtkTreeModel *model)
|
|
|
|
{
|
|
|
|
GtkTreePath *path;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkAction *action;
|
|
|
|
gboolean visible;
|
|
|
|
|
|
|
|
path = gtk_tree_path_new_from_string (path_str);
|
|
|
|
gtk_tree_model_get_iter (model, &iter, path);
|
|
|
|
|
|
|
|
gtk_tree_model_get (model, &iter, 0, &action, -1);
|
|
|
|
g_object_get (G_OBJECT (action), "visible", &visible, NULL);
|
|
|
|
g_object_set (G_OBJECT (action), "visible", !visible, NULL);
|
|
|
|
gtk_tree_model_row_changed (model, path, &iter);
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
iter_compare_func (GtkTreeModel *model,
|
|
|
|
GtkTreeIter *a,
|
|
|
|
GtkTreeIter *b,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
GValue a_value = { 0, }, b_value = { 0, };
|
|
|
|
GtkAction *a_action, *b_action;
|
|
|
|
const gchar *a_name, *b_name;
|
|
|
|
gint retval = 0;
|
|
|
|
|
|
|
|
gtk_tree_model_get_value (model, a, 0, &a_value);
|
|
|
|
gtk_tree_model_get_value (model, b, 0, &b_value);
|
|
|
|
a_action = GTK_ACTION (g_value_get_object (&a_value));
|
|
|
|
b_action = GTK_ACTION (g_value_get_object (&b_value));
|
|
|
|
|
|
|
|
a_name = gtk_action_get_name (a_action);
|
|
|
|
b_name = gtk_action_get_name (b_action);
|
|
|
|
if (a_name == NULL && b_name == NULL)
|
|
|
|
retval = 0;
|
|
|
|
else if (a_name == NULL)
|
|
|
|
retval = -1;
|
|
|
|
else if (b_name == NULL)
|
|
|
|
retval = 1;
|
|
|
|
else
|
|
|
|
retval = strcmp (a_name, b_name);
|
|
|
|
|
|
|
|
g_value_unset (&b_value);
|
|
|
|
g_value_unset (&a_value);
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget *
|
2003-08-25 23:13:47 +00:00
|
|
|
create_tree_view (GtkUIManager *merge)
|
2003-08-24 19:58:30 +00:00
|
|
|
{
|
|
|
|
GtkWidget *tree_view, *sw;
|
|
|
|
GtkListStore *store;
|
|
|
|
GList *p;
|
|
|
|
GtkCellRenderer *cell;
|
|
|
|
|
|
|
|
store = gtk_list_store_new (1, GTK_TYPE_ACTION);
|
|
|
|
gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (store), 0,
|
|
|
|
iter_compare_func, NULL, NULL);
|
|
|
|
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store), 0,
|
|
|
|
GTK_SORT_ASCENDING);
|
|
|
|
|
2003-08-25 23:13:47 +00:00
|
|
|
for (p = gtk_ui_manager_get_action_groups (merge); p; p = p->next)
|
2003-08-24 19:58:30 +00:00
|
|
|
{
|
|
|
|
GList *actions, *l;
|
|
|
|
|
|
|
|
actions = gtk_action_group_list_actions (p->data);
|
|
|
|
|
|
|
|
for (l = actions; l; l = l->next)
|
|
|
|
{
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
|
|
|
gtk_list_store_append (store, &iter);
|
|
|
|
gtk_list_store_set (store, &iter, 0, l->data, -1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
|
|
|
|
g_object_unref (store);
|
|
|
|
|
|
|
|
gtk_tree_view_insert_column_with_data_func (GTK_TREE_VIEW (tree_view),
|
|
|
|
-1, "Action",
|
|
|
|
gtk_cell_renderer_text_new (),
|
|
|
|
set_name_func, NULL, NULL);
|
|
|
|
|
|
|
|
gtk_tree_view_column_set_sort_column_id (gtk_tree_view_get_column (GTK_TREE_VIEW (tree_view), 0), 0);
|
|
|
|
|
|
|
|
cell = gtk_cell_renderer_toggle_new ();
|
|
|
|
g_signal_connect (cell, "toggled", G_CALLBACK (sensitivity_toggled), store);
|
|
|
|
gtk_tree_view_insert_column_with_data_func (GTK_TREE_VIEW (tree_view),
|
|
|
|
-1, "Sensitive",
|
|
|
|
cell,
|
|
|
|
set_sensitive_func, NULL, NULL);
|
|
|
|
|
|
|
|
cell = gtk_cell_renderer_toggle_new ();
|
|
|
|
g_signal_connect (cell, "toggled", G_CALLBACK (visibility_toggled), store);
|
|
|
|
gtk_tree_view_insert_column_with_data_func (GTK_TREE_VIEW (tree_view),
|
|
|
|
-1, "Visible",
|
|
|
|
cell,
|
|
|
|
set_visible_func, NULL, NULL);
|
|
|
|
|
|
|
|
sw = gtk_scrolled_window_new (NULL, NULL);
|
|
|
|
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
|
|
|
|
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
|
|
|
|
gtk_container_add (GTK_CONTAINER (sw), tree_view);
|
|
|
|
|
|
|
|
return sw;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
area_press (GtkWidget *drawing_area,
|
|
|
|
GdkEventButton *event,
|
2003-08-25 23:13:47 +00:00
|
|
|
GtkUIManager *merge)
|
2003-08-24 19:58:30 +00:00
|
|
|
{
|
|
|
|
gtk_widget_grab_focus (drawing_area);
|
|
|
|
|
|
|
|
if (event->button == 3 &&
|
|
|
|
event->type == GDK_BUTTON_PRESS)
|
|
|
|
{
|
Change the XML format: <Root> element is replaced by <ui>, <menu> element
2003-08-28 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.c: Change the XML format:
<Root> element is replaced by <ui>,
<menu> element is replaced by <menubar>,
<submenu> element is replaced by <menu>,
<dockitem> element is replaced by <toolbar>,
<popups> element is gone,
verb attribute is replaced by action,
name defaults to action or the element name.
* gtk/gtkactiongroup.[hc]: Replace GtkActionGroupEntry by GtkActionEntry
and GtkRadioActionEntry. GtkActionEntry is simplified by removing
the user_data, entry_type and extra_data fields, GtkRadioActionEntry is
further simplified by removing the callback. The user_data can now be
specified as an argument to gtk_action_group_add_actions(). There is
a new method gtk_action_group_add_radio_actions(), which is similar
to gtk_action_group_add_actions(), but takes GtkRadioActionEntrys
and a callback parameter in addition to the user_data. The callback
is connected to the ::changed signal of the first group member.
There are _full() variants taking a GDestroyNotify of
gtk_action_group_add_[radio_]actions().
* gtk/gtkradioaction.[hc]: Add a ::changed signal which gets emitted
on every member of the radio group when the active member is changed.
Add an integer property "value", and a getter for the value of "value"
on the currently active group member.
* tests/testactions.c:
* tests/testmerge.c:
* tests/merge-[123].ui:
* demos/gtk-demo/appwindow.c: Adjust to these changes.
* gtk/gtktoolbar.c (gtk_toolbar_append_element): Trivial doc fix.
2003-08-27 22:22:28 +00:00
|
|
|
GtkWidget *menu = gtk_ui_manager_get_widget (merge, "/FileMenu");
|
2003-08-24 19:58:30 +00:00
|
|
|
|
|
|
|
if (GTK_IS_MENU (menu))
|
|
|
|
{
|
|
|
|
gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
|
|
|
|
NULL, drawing_area,
|
|
|
|
3, event->time);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2003-08-30 21:18:43 +00:00
|
|
|
static void
|
|
|
|
activate_path (GtkWidget *button,
|
|
|
|
GtkUIManager *merge)
|
|
|
|
{
|
2003-08-31 13:49:15 +00:00
|
|
|
GtkAction *action = gtk_ui_manager_get_action (merge,
|
|
|
|
"/menubar/HelpMenu/About");
|
|
|
|
if (action)
|
|
|
|
gtk_action_activate (action);
|
|
|
|
else
|
|
|
|
g_message ("no action found");
|
2003-08-30 21:18:43 +00:00
|
|
|
}
|
|
|
|
|
2003-09-26 23:01:32 +00:00
|
|
|
typedef struct _ActionStatus ActionStatus;
|
|
|
|
|
|
|
|
struct _ActionStatus {
|
|
|
|
GtkAction *action;
|
|
|
|
GtkWidget *statusbar;
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
action_status_destroy (gpointer data)
|
|
|
|
{
|
|
|
|
ActionStatus *action_status = data;
|
|
|
|
|
|
|
|
g_object_unref (action_status->action);
|
|
|
|
g_object_unref (action_status->statusbar);
|
|
|
|
|
|
|
|
g_free (action_status);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
set_tip (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
ActionStatus *data;
|
|
|
|
gchar *tooltip;
|
|
|
|
|
|
|
|
data = g_object_get_data (G_OBJECT (widget), "action-status");
|
|
|
|
|
|
|
|
if (data)
|
|
|
|
{
|
|
|
|
g_object_get (G_OBJECT (data->action), "tooltip", &tooltip, NULL);
|
|
|
|
|
|
|
|
gtk_statusbar_push (GTK_STATUSBAR (data->statusbar), 0,
|
|
|
|
tooltip ? tooltip : "");
|
|
|
|
|
|
|
|
g_free (tooltip);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
unset_tip (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
ActionStatus *data;
|
|
|
|
|
|
|
|
data = g_object_get_data (G_OBJECT (widget), "action-status");
|
|
|
|
|
|
|
|
if (data)
|
|
|
|
gtk_statusbar_pop (GTK_STATUSBAR (data->statusbar), 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-01-12 22:45:45 +00:00
|
|
|
connect_proxy (GtkUIManager *merge,
|
|
|
|
GtkAction *action,
|
2003-09-26 23:01:32 +00:00
|
|
|
GtkWidget *proxy,
|
|
|
|
GtkWidget *statusbar)
|
|
|
|
{
|
|
|
|
if (GTK_IS_MENU_ITEM (proxy))
|
|
|
|
{
|
|
|
|
ActionStatus *data;
|
|
|
|
|
|
|
|
data = g_object_get_data (G_OBJECT (proxy), "action-status");
|
|
|
|
if (data)
|
|
|
|
{
|
|
|
|
g_object_unref (data->action);
|
|
|
|
g_object_unref (data->statusbar);
|
|
|
|
|
|
|
|
data->action = g_object_ref (action);
|
|
|
|
data->statusbar = g_object_ref (statusbar);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
data = g_new0 (ActionStatus, 1);
|
|
|
|
|
|
|
|
data->action = g_object_ref (action);
|
|
|
|
data->statusbar = g_object_ref (statusbar);
|
|
|
|
|
|
|
|
g_object_set_data_full (G_OBJECT (proxy), "action-status",
|
|
|
|
data, action_status_destroy);
|
|
|
|
|
|
|
|
g_signal_connect (proxy, "select", G_CALLBACK (set_tip), 0);
|
|
|
|
g_signal_connect (proxy, "deselect", G_CALLBACK (unset_tip), 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-08-24 19:58:30 +00:00
|
|
|
int
|
|
|
|
main (int argc, char **argv)
|
|
|
|
{
|
|
|
|
GtkActionGroup *action_group;
|
2003-09-26 23:01:32 +00:00
|
|
|
GtkAction *action;
|
2003-08-25 23:13:47 +00:00
|
|
|
GtkUIManager *merge;
|
2003-08-30 21:18:43 +00:00
|
|
|
GtkWidget *window, *table, *frame, *menu_box, *vbox, *view;
|
2003-09-26 23:01:32 +00:00
|
|
|
GtkWidget *button, *area, *statusbar;
|
2003-08-24 19:58:30 +00:00
|
|
|
gint i;
|
|
|
|
|
|
|
|
gtk_init (&argc, &argv);
|
|
|
|
|
|
|
|
action_group = gtk_action_group_new ("TestActions");
|
2003-09-15 19:51:55 +00:00
|
|
|
gtk_action_group_add_actions (action_group,
|
|
|
|
entries, n_entries,
|
|
|
|
NULL);
|
2003-09-30 20:55:24 +00:00
|
|
|
action = gtk_action_group_get_action (action_group, "EmptyMenu1Action");
|
2003-10-01 19:07:36 +00:00
|
|
|
g_object_set (G_OBJECT (action), "hide_if_empty", FALSE, NULL);
|
2003-09-30 20:55:24 +00:00
|
|
|
action = gtk_action_group_get_action (action_group, "EmptyMenu2Action");
|
2003-10-01 19:07:36 +00:00
|
|
|
g_object_set (G_OBJECT (action), "hide_if_empty", TRUE, NULL);
|
2003-09-15 19:51:55 +00:00
|
|
|
gtk_action_group_add_toggle_actions (action_group,
|
|
|
|
toggle_entries, n_toggle_entries,
|
|
|
|
NULL);
|
2003-08-30 21:18:43 +00:00
|
|
|
gtk_action_group_add_radio_actions (action_group,
|
|
|
|
radio_entries, n_radio_entries,
|
2003-09-22 08:54:23 +00:00
|
|
|
JUSTIFY_RIGHT,
|
Change the XML format: <Root> element is replaced by <ui>, <menu> element
2003-08-28 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.c: Change the XML format:
<Root> element is replaced by <ui>,
<menu> element is replaced by <menubar>,
<submenu> element is replaced by <menu>,
<dockitem> element is replaced by <toolbar>,
<popups> element is gone,
verb attribute is replaced by action,
name defaults to action or the element name.
* gtk/gtkactiongroup.[hc]: Replace GtkActionGroupEntry by GtkActionEntry
and GtkRadioActionEntry. GtkActionEntry is simplified by removing
the user_data, entry_type and extra_data fields, GtkRadioActionEntry is
further simplified by removing the callback. The user_data can now be
specified as an argument to gtk_action_group_add_actions(). There is
a new method gtk_action_group_add_radio_actions(), which is similar
to gtk_action_group_add_actions(), but takes GtkRadioActionEntrys
and a callback parameter in addition to the user_data. The callback
is connected to the ::changed signal of the first group member.
There are _full() variants taking a GDestroyNotify of
gtk_action_group_add_[radio_]actions().
* gtk/gtkradioaction.[hc]: Add a ::changed signal which gets emitted
on every member of the radio group when the active member is changed.
Add an integer property "value", and a getter for the value of "value"
on the currently active group member.
* tests/testactions.c:
* tests/testmerge.c:
* tests/merge-[123].ui:
* demos/gtk-demo/appwindow.c: Adjust to these changes.
* gtk/gtktoolbar.c (gtk_toolbar_append_element): Trivial doc fix.
2003-08-27 22:22:28 +00:00
|
|
|
G_CALLBACK (radio_action_changed), NULL);
|
2003-08-24 19:58:30 +00:00
|
|
|
|
|
|
|
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
|
|
|
gtk_window_set_default_size (GTK_WINDOW (window), -1, 400);
|
|
|
|
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
|
|
|
|
|
|
|
|
table = gtk_table_new (2, 2, FALSE);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (window), table);
|
|
|
|
|
|
|
|
frame = gtk_frame_new ("Menus and Toolbars");
|
|
|
|
gtk_table_attach (GTK_TABLE (table), frame, 0,2, 1,2,
|
|
|
|
GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
|
|
|
|
|
|
|
|
menu_box = gtk_vbox_new (FALSE, 0);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (menu_box), 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), menu_box);
|
2003-09-26 23:01:32 +00:00
|
|
|
|
|
|
|
statusbar = gtk_statusbar_new ();
|
|
|
|
gtk_box_pack_end (GTK_BOX (menu_box), statusbar, FALSE, FALSE, 0);
|
|
|
|
|
2003-08-24 19:58:30 +00:00
|
|
|
area = gtk_drawing_area_new ();
|
|
|
|
gtk_widget_set_events (area, GDK_BUTTON_PRESS_MASK);
|
|
|
|
gtk_widget_set_size_request (area, -1, 40);
|
|
|
|
gtk_box_pack_end (GTK_BOX (menu_box), area, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (area);
|
|
|
|
|
2003-09-04 21:34:15 +00:00
|
|
|
button = gtk_button_new ();
|
|
|
|
gtk_box_pack_end (GTK_BOX (menu_box), button, FALSE, FALSE, 0);
|
|
|
|
gtk_action_connect_proxy (gtk_action_group_get_action (action_group, "AboutAction"),
|
|
|
|
button);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
button = gtk_check_button_new ();
|
|
|
|
gtk_box_pack_end (GTK_BOX (menu_box), button, FALSE, FALSE, 0);
|
|
|
|
gtk_action_connect_proxy (gtk_action_group_get_action (action_group, "BoldAction"),
|
|
|
|
button);
|
|
|
|
gtk_widget_show (button);
|
2003-08-24 19:58:30 +00:00
|
|
|
|
2003-09-26 23:01:32 +00:00
|
|
|
merge = gtk_ui_manager_new ();
|
2004-01-12 22:45:45 +00:00
|
|
|
|
|
|
|
g_signal_connect (merge, "connect-proxy", G_CALLBACK (connect_proxy), statusbar);
|
2003-09-26 23:01:32 +00:00
|
|
|
g_signal_connect (area, "button_press_event", G_CALLBACK (area_press), merge);
|
2003-08-24 19:58:30 +00:00
|
|
|
|
2003-08-25 23:13:47 +00:00
|
|
|
gtk_ui_manager_insert_action_group (merge, action_group, 0);
|
2003-08-24 19:58:30 +00:00
|
|
|
g_signal_connect (merge, "add_widget", G_CALLBACK (add_widget), menu_box);
|
|
|
|
|
|
|
|
gtk_window_add_accel_group (GTK_WINDOW (window),
|
2003-08-25 23:13:47 +00:00
|
|
|
gtk_ui_manager_get_accel_group (merge));
|
2003-08-24 19:58:30 +00:00
|
|
|
|
|
|
|
frame = gtk_frame_new ("UI Files");
|
|
|
|
gtk_table_attach (GTK_TABLE (table), frame, 0,1, 0,1,
|
|
|
|
GTK_FILL, GTK_FILL|GTK_EXPAND, 0, 0);
|
|
|
|
|
|
|
|
vbox = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), vbox);
|
|
|
|
|
|
|
|
for (i = 0; i < G_N_ELEMENTS (merge_ids); i++)
|
|
|
|
{
|
|
|
|
button = gtk_check_button_new_with_label (merge_ids[i].filename);
|
|
|
|
g_object_set_data (G_OBJECT (button), "mergenum", GINT_TO_POINTER (i));
|
|
|
|
g_signal_connect (button, "toggled", G_CALLBACK (toggle_merge), merge);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
|
|
|
|
}
|
|
|
|
|
2003-08-29 22:42:37 +00:00
|
|
|
button = gtk_check_button_new_with_label ("Tearoffs");
|
|
|
|
g_signal_connect (button, "clicked", G_CALLBACK (toggle_tearoffs), merge);
|
|
|
|
gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
|
|
|
|
2003-09-04 20:39:15 +00:00
|
|
|
button = gtk_check_button_new_with_label ("Dynamic");
|
|
|
|
g_signal_connect (button, "clicked", G_CALLBACK (toggle_dynamic), merge);
|
|
|
|
gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
|
|
|
|
2003-08-30 21:18:43 +00:00
|
|
|
button = gtk_button_new_with_label ("Activate path");
|
|
|
|
g_signal_connect (button, "clicked", G_CALLBACK (activate_path), merge);
|
|
|
|
gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
button = gtk_button_new_with_label ("Dump Tree");
|
2003-08-24 19:58:30 +00:00
|
|
|
g_signal_connect (button, "clicked", G_CALLBACK (dump_tree), merge);
|
2003-08-29 22:42:37 +00:00
|
|
|
gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
2003-08-24 19:58:30 +00:00
|
|
|
|
2004-01-08 23:37:34 +00:00
|
|
|
button = gtk_button_new_with_label ("Dump Toplevels");
|
|
|
|
g_signal_connect (button, "clicked", G_CALLBACK (dump_toplevels), merge);
|
|
|
|
gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
|
|
|
|
2003-09-17 23:58:28 +00:00
|
|
|
button = gtk_button_new_with_label ("Dump Accels");
|
|
|
|
g_signal_connect (button, "clicked", G_CALLBACK (dump_accels), NULL);
|
|
|
|
gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
|
|
|
|
2003-08-24 19:58:30 +00:00
|
|
|
view = create_tree_view (merge);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), view, 1,2, 0,1,
|
|
|
|
GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND, 0, 0);
|
|
|
|
|
|
|
|
gtk_widget_show_all (window);
|
|
|
|
gtk_main ();
|
|
|
|
|
2003-09-22 08:54:23 +00:00
|
|
|
g_object_unref (action_group);
|
|
|
|
g_object_unref (merge);
|
2003-08-24 19:58:30 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|