static void browser_tooltips (void) { MidoriBrowser* browser; GtkActionGroup* action_group; GList* actions; gchar* toolbar; guint errors = 0; browser = midori_browser_new (); action_group = midori_browser_get_action_group (browser); actions = gtk_action_group_list_actions (action_group); toolbar = g_strjoinv (" ", (gchar**)midori_browser_get_toolbar_actions (browser)); while (actions) { GtkAction* action = actions->data; const gchar* name = gtk_action_get_name (action); if (strstr ("CompactMenu Location Separator", name)) { actions = g_list_next (actions); continue; } if (strstr (toolbar, name) != NULL) { if (!gtk_action_get_tooltip (action)) { printf ("'%s' can be toolbar item but tooltip is unset\n", name); errors++; } } else { if (gtk_action_get_tooltip (action)) { printf ("'%s' is no toolbar item but tooltip is set\n", name); errors++; } } actions = g_list_next (actions); } g_free (toolbar); g_list_free (actions); gtk_widget_destroy (GTK_WIDGET (browser)); if (errors) g_error ("Tooltip errors"); }
static void gtk_tool_item_update (GtkActivatable *activatable, GtkAction *action, const gchar *property_name) { if (strcmp (property_name, "visible") == 0) { if (gtk_action_is_visible (action)) gtk_widget_show (GTK_WIDGET (activatable)); else gtk_widget_hide (GTK_WIDGET (activatable)); } else if (strcmp (property_name, "sensitive") == 0) gtk_widget_set_sensitive (GTK_WIDGET (activatable), gtk_action_is_sensitive (action)); else if (strcmp (property_name, "tooltip") == 0) gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (activatable), gtk_action_get_tooltip (action)); else if (strcmp (property_name, "visible-horizontal") == 0) gtk_tool_item_set_visible_horizontal (GTK_TOOL_ITEM (activatable), gtk_action_get_visible_horizontal (action)); else if (strcmp (property_name, "visible-vertical") == 0) gtk_tool_item_set_visible_vertical (GTK_TOOL_ITEM (activatable), gtk_action_get_visible_vertical (action)); else if (strcmp (property_name, "is-important") == 0) gtk_tool_item_set_is_important (GTK_TOOL_ITEM (activatable), gtk_action_get_is_important (action)); }
static GtkWidget * toolbar_create_toolbutton (NemoToolbar *self, gboolean create_toggle, const gchar *name) { GtkWidget *button; GtkWidget *image; GtkAction *action; if (create_toggle) { button = gtk_toggle_button_new (); } else { button = gtk_button_new (); } image = gtk_image_new (); gtk_button_set_image (GTK_BUTTON (button), image); action = gtk_action_group_get_action (self->priv->action_group, name); gtk_activatable_set_related_action (GTK_ACTIVATABLE (button), action); gtk_button_set_label (GTK_BUTTON (button), NULL); gtk_widget_set_tooltip_text (button, gtk_action_get_tooltip (action)); return button; }
gboolean wikipad_statusbar_push_tooltip (WikipadStatusbar *statusbar, GtkWidget *widget) { GtkAction *action = NULL; const gchar *tooltip = NULL; gint id; /* get the widget's related action */ action = wikipad_util_find_related_action (widget); /* if the action has a tooltip, use it */ if (G_LIKELY (action != NULL)) tooltip = gtk_action_get_tooltip (action); /* if the action doesn't have a tooltip, see if the widget has one */ if (G_UNLIKELY (tooltip == NULL) && gtk_widget_get_has_tooltip (widget)) tooltip = gtk_widget_get_tooltip_text (widget); if (G_LIKELY (tooltip != NULL)) { /* show the tooltip */ id = gtk_statusbar_get_context_id (GTK_STATUSBAR (statusbar), "tooltip"); gtk_statusbar_push (GTK_STATUSBAR (statusbar), id, tooltip); return TRUE; } return FALSE; }
void GtkPopupMenu::appendItem(GtkAction* action) { GtkWidget* menuItem = gtk_action_create_menu_item(action); gtk_widget_set_tooltip_text(menuItem, gtk_action_get_tooltip(action)); g_signal_connect(menuItem, "select", G_CALLBACK(GtkPopupMenu::selectItemCallback), this); gtk_menu_shell_append(GTK_MENU_SHELL(m_popup.get()), menuItem); if (gtk_action_is_visible(action)) gtk_widget_show(menuItem); }
static void gimp_action_set_proxy_tooltip (GimpAction *action, GtkWidget *proxy) { const gchar *tooltip = gtk_action_get_tooltip (GTK_ACTION (action)); if (tooltip) gimp_help_set_help_data (proxy, tooltip, g_object_get_qdata (G_OBJECT (proxy), GIMP_HELP_ID)); }
static void gimp_ui_manager_menu_item_select (GtkWidget *widget, GimpUIManager *manager) { GtkAction *action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (widget)); if (action) { const gchar *tooltip = gtk_action_get_tooltip (action); if (tooltip) g_signal_emit (manager, manager_signals[SHOW_TOOLTIP], 0, tooltip); } }
static void gimp_widget_accel_changed (GtkAccelGroup *accel_group, guint unused1, GdkModifierType unused2, GClosure *accel_closure, GtkWidget *widget) { GClosure *widget_closure; widget_closure = g_object_get_data (G_OBJECT (widget), "gimp-accel-closure"); if (accel_closure == widget_closure) { GtkAction *action; GtkAccelKey *accel_key; const gchar *tooltip; const gchar *help_id; action = g_object_get_data (G_OBJECT (widget), "gimp-accel-action"); tooltip = gtk_action_get_tooltip (action); help_id = g_object_get_qdata (G_OBJECT (action), GIMP_HELP_ID); accel_key = gtk_accel_group_find (accel_group, gimp_widget_accel_find_func, accel_closure); if (accel_key && accel_key->accel_key && accel_key->accel_flags & GTK_ACCEL_VISIBLE) { gchar *escaped = g_markup_escape_text (tooltip, -1); gchar *accel = gtk_accelerator_get_label (accel_key->accel_key, accel_key->accel_mods); gchar *tmp = g_strdup_printf ("%s <b>%s</b>", escaped, accel); g_free (accel); g_free (escaped); gimp_help_set_help_data_with_markup (widget, tmp, help_id); g_free (tmp); } else { gimp_help_set_help_data (widget, tooltip, help_id); } } }
void WebPopupMenuProxyGtk::populatePopupMenu(const Vector<WebPopupItem>& items) { int itemIndex = 0; for (const auto& item : items) { if (item.m_type == WebPopupItem::Separator) { GtkWidget* menuItem = gtk_separator_menu_item_new(); gtk_menu_shell_append(GTK_MENU_SHELL(m_popup), menuItem); gtk_widget_show(menuItem); } else { GRefPtr<GtkAction> action = adoptGRef(createGtkActionForMenuItem(item, itemIndex)); GtkWidget* menuItem = gtk_action_create_menu_item(action.get()); gtk_widget_set_tooltip_text(menuItem, gtk_action_get_tooltip(action.get())); g_signal_connect(menuItem, "select", G_CALLBACK(selectItemCallback), this); gtk_menu_shell_append(GTK_MENU_SHELL(m_popup), menuItem); if (gtk_action_is_visible(action.get())) gtk_widget_show(menuItem); } itemIndex++; } }
const gchar * gimp_action_group_get_action_tooltip (GimpActionGroup *group, const gchar *action_name) { GtkAction *action; g_return_val_if_fail (GIMP_IS_ACTION_GROUP (group), NULL); g_return_val_if_fail (action_name != NULL, NULL); action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), action_name); if (! action) { g_warning ("%s: Unable to get tooltip of action " "which doesn't exist: %s", G_STRFUNC, action_name); return NULL; } return gtk_action_get_tooltip (action); }
static void shell_window_menu_item_select_cb (EShellWindow *shell_window, GtkWidget *widget) { GtkAction *action; GtkActivatable *activatable; GtkLabel *label; const gchar *tooltip; activatable = GTK_ACTIVATABLE (widget); action = gtk_activatable_get_related_action (activatable); tooltip = gtk_action_get_tooltip (action); if (tooltip == NULL) return; label = GTK_LABEL (shell_window->priv->tooltip_label); gtk_label_set_text (label, tooltip); gtk_widget_show (shell_window->priv->tooltip_label); gtk_widget_hide (shell_window->priv->status_notebook); }
static GtkWidget * toolbar_create_toolbutton (NautilusToolbar *self, gboolean create_menu, gboolean create_toggle, const gchar *name, const gchar *tooltip) { GtkWidget *button, *image; GtkActionGroup *action_group; GtkAction *action; action_group = nautilus_window_get_main_action_group (self->priv->window); if (create_menu) { button = gtk_menu_button_new (); } else if (create_toggle) { button = gtk_toggle_button_new (); } else { button = gtk_button_new (); } image = gtk_image_new (); gtk_button_set_image (GTK_BUTTON (button), image); if (create_menu) { gtk_image_set_from_icon_name (GTK_IMAGE (image), name, GTK_ICON_SIZE_MENU); gtk_widget_set_tooltip_text (button, tooltip); } else { action = gtk_action_group_get_action (action_group, name); gtk_activatable_set_related_action (GTK_ACTIVATABLE (button), action); gtk_button_set_label (GTK_BUTTON (button), NULL); gtk_widget_set_tooltip_text (button, gtk_action_get_tooltip (action)); } return button; }
static void gtk_tool_item_sync_action_properties (GtkActivatable *activatable, GtkAction *action) { if (!action) return; if (gtk_action_is_visible (action)) gtk_widget_show (GTK_WIDGET (activatable)); else gtk_widget_hide (GTK_WIDGET (activatable)); gtk_widget_set_sensitive (GTK_WIDGET (activatable), gtk_action_is_sensitive (action)); gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (activatable), gtk_action_get_tooltip (action)); gtk_tool_item_set_visible_horizontal (GTK_TOOL_ITEM (activatable), gtk_action_get_visible_horizontal (action)); gtk_tool_item_set_visible_vertical (GTK_TOOL_ITEM (activatable), gtk_action_get_visible_vertical (action)); gtk_tool_item_set_is_important (GTK_TOOL_ITEM (activatable), gtk_action_get_is_important (action)); }
static void assign_tooltip_from_action(GtkWidget* widget) { GtkAction* action; const gchar * tooltip; action = gtk_activatable_get_related_action(GTK_ACTIVATABLE(widget)); if (!action) return; if (!gtk_activatable_get_use_action_appearance(GTK_ACTIVATABLE(widget))) return; tooltip = gtk_action_get_tooltip(action); if (tooltip) { gtk_widget_set_tooltip_text(widget, tooltip); gtk_widget_set_has_tooltip(widget, TRUE); } else { gtk_widget_set_has_tooltip(widget, FALSE); } }
void gimp_widget_set_accel_help (GtkWidget *widget, GtkAction *action) { GClosure *accel_closure = gtk_action_get_accel_closure (action); if (accel_closure) { GtkAccelGroup *accel_group; g_object_set_data (G_OBJECT (widget), "gimp-accel-closure", accel_closure); g_object_set_data (G_OBJECT (widget), "gimp-accel-action", action); accel_group = gtk_accel_group_from_accel_closure (accel_closure); g_signal_connect_object (accel_group, "accel-changed", G_CALLBACK (gimp_widget_accel_changed), widget, 0); gimp_widget_accel_changed (accel_group, 0, 0, accel_closure, widget); } else { const gchar *tooltip; const gchar *help_id; tooltip = gtk_action_get_tooltip (action); help_id = g_object_get_qdata (G_OBJECT (action), GIMP_HELP_ID); gimp_help_set_help_data (widget, tooltip, help_id); } }
static void mail_browser_menu_item_select_cb (EMailBrowser *browser, GtkWidget *widget) { GtkAction *action; GtkActivatable *activatable; GtkStatusbar *statusbar; const gchar *tooltip; guint context_id; gpointer data; activatable = GTK_ACTIVATABLE (widget); action = gtk_activatable_get_related_action (activatable); tooltip = gtk_action_get_tooltip (action); data = g_object_get_data (G_OBJECT (widget), "context-id"); context_id = GPOINTER_TO_UINT (data); if (tooltip == NULL) return; statusbar = GTK_STATUSBAR (browser->priv->statusbar); gtk_statusbar_push (statusbar, context_id, tooltip); }
GtkWidget * gimp_editor_add_action_button (GimpEditor *editor, const gchar *group_name, const gchar *action_name, ...) { GimpActionGroup *group; GtkAction *action; GtkWidget *button; GtkWidget *old_child; GtkWidget *image; GtkIconSize button_icon_size; GtkReliefStyle button_relief; const gchar *stock_id; gchar *tooltip; const gchar *help_id; GList *extended = NULL; va_list args; g_return_val_if_fail (GIMP_IS_EDITOR (editor), NULL); g_return_val_if_fail (action_name != NULL, NULL); g_return_val_if_fail (editor->ui_manager != NULL, NULL); group = gimp_ui_manager_get_action_group (editor->ui_manager, group_name); g_return_val_if_fail (group != NULL, NULL); action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), action_name); g_return_val_if_fail (action != NULL, NULL); button_icon_size = gimp_editor_ensure_button_box (editor, &button_relief); if (GTK_IS_TOGGLE_ACTION (action)) button = gtk_toggle_button_new (); else button = gimp_button_new (); gtk_button_set_relief (GTK_BUTTON (button), button_relief); stock_id = gtk_action_get_stock_id (action); tooltip = g_strdup (gtk_action_get_tooltip (action)); old_child = gtk_bin_get_child (GTK_BIN (button)); if (old_child) gtk_container_remove (GTK_CONTAINER (button), old_child); image = gtk_image_new_from_stock (stock_id, button_icon_size); gtk_container_add (GTK_CONTAINER (button), image); gtk_widget_show (image); gtk_activatable_set_related_action (GTK_ACTIVATABLE (button), action); gtk_box_pack_start (GTK_BOX (editor->button_box), button, TRUE, TRUE, 0); gtk_widget_show (button); va_start (args, action_name); action_name = va_arg (args, const gchar *); while (action_name) { GdkModifierType mod_mask; mod_mask = va_arg (args, GdkModifierType); action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), action_name); if (action && mod_mask) { ExtendedAction *ext = g_slice_new (ExtendedAction); ext->mod_mask = mod_mask; ext->action = action; extended = g_list_prepend (extended, ext); if (tooltip) { const gchar *ext_tooltip = gtk_action_get_tooltip (action); if (ext_tooltip) { gchar *tmp = g_strconcat (tooltip, "\n<b>", gimp_get_mod_string (mod_mask), "</b> ", ext_tooltip, NULL); g_free (tooltip); tooltip = tmp; } } } action_name = va_arg (args, const gchar *); } va_end (args); if (extended) { g_object_set_data_full (G_OBJECT (button), "extended-actions", extended, (GDestroyNotify) gimp_editor_button_extended_actions_free); g_signal_connect (button, "extended-clicked", G_CALLBACK (gimp_editor_button_extended_clicked), NULL); } help_id = g_object_get_qdata (G_OBJECT (action), GIMP_HELP_ID); if (tooltip || help_id) gimp_help_set_help_data_with_markup (button, tooltip, help_id); g_free (tooltip); return button; }
static void seahorse_generate_select_constructed (GObject *obj) { SeahorseGenerateSelect *self = SEAHORSE_GENERATE_SELECT (obj); gchar *text; GtkCellRenderer *pixcell; GtkTreeSelection *selection; GtkTreeIter iter; GList *actions; GList *l, *k; GIcon *icon; GtkBuilder *builder; const gchar *path; GError *error = NULL; const gchar *icon_name; GtkAction *action; G_OBJECT_CLASS (seahorse_generate_select_parent_class)->constructed (obj); self->store = gtk_list_store_new (COLUMN_N_COLUMNS, G_TYPE_ICON, G_TYPE_STRING, GTK_TYPE_ACTION); gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (self->store), on_list_sort, NULL, NULL); gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (self->store), GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, GTK_SORT_ASCENDING); self->action_groups = seahorse_registry_object_instances ("generator"); for (l = self->action_groups; l != NULL; l = g_list_next (l)) { actions = gtk_action_group_list_actions (l->data); for (k = actions; k != NULL; k = g_list_next (k)) { action = k->data; text = g_strdup_printf (TEMPLATE, gtk_action_get_label (action), gtk_action_get_tooltip (action)); icon = gtk_action_get_gicon (action); if (icon == NULL) { icon_name = gtk_action_get_icon_name (action); if (icon_name) icon = g_themed_icon_new (icon_name); gtk_action_get_stock_id (action); } else { g_object_ref (icon); } gtk_list_store_append (self->store, &iter); gtk_list_store_set (self->store, &iter, COLUMN_TEXT, text, COLUMN_ICON, icon, COLUMN_ACTION, k->data, -1); g_clear_object (&icon); } g_list_free (actions); } builder = gtk_builder_new (); path = "/org/gnome/Seahorse/seahorse-generate-select.xml"; gtk_builder_add_from_resource (builder, path, &error); if (error != NULL) { g_warning ("couldn't load ui file: %s", path); g_clear_error (&error); g_object_unref (builder); return; } /* Setup the dialog */ gtk_window_set_modal (GTK_WINDOW (self), TRUE); gtk_window_set_default_size (GTK_WINDOW (self), -1, 410); gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (self))), GTK_WIDGET (gtk_builder_get_object (builder, "generate-select")), TRUE, TRUE, 0); gtk_dialog_add_buttons (GTK_DIALOG (self), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, _("Continue"), GTK_RESPONSE_OK, NULL); /* Hook it into the view */ self->view = GTK_TREE_VIEW (gtk_builder_get_object (builder, "keytype-tree")); g_object_unref (builder); pixcell = gtk_cell_renderer_pixbuf_new (); g_object_set (pixcell, "stock-size", GTK_ICON_SIZE_DND, NULL); gtk_tree_view_insert_column_with_attributes (self->view, -1, "", pixcell, "gicon", COLUMN_ICON, NULL); gtk_tree_view_insert_column_with_attributes (self->view, -1, "", gtk_cell_renderer_text_new (), "markup", COLUMN_TEXT, NULL); gtk_tree_view_set_model (self->view, GTK_TREE_MODEL (self->store)); /* Setup selection, select first item */ selection = gtk_tree_view_get_selection (self->view); gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE); gtk_tree_model_get_iter_first (GTK_TREE_MODEL (self->store), &iter); gtk_tree_selection_select_iter (selection, &iter); g_signal_connect (self->view, "row-activated", G_CALLBACK (on_row_activated), self); g_object_set (self->view, "height-request", 410, NULL); g_signal_connect (self, "response", G_CALLBACK (on_response), self); }
GtkWidget * gimp_action_view_new (GimpUIManager *manager, const gchar *select_action, gboolean show_shortcuts) { GtkTreeView *view; GtkTreeViewColumn *column; GtkCellRenderer *cell; GtkTreeStore *store; GtkTreeModel *filter; GtkAccelGroup *accel_group; GList *list; GtkTreePath *select_path = NULL; g_return_val_if_fail (GIMP_IS_UI_MANAGER (manager), NULL); store = gtk_tree_store_new (GIMP_ACTION_VIEW_N_COLUMNS, G_TYPE_BOOLEAN, /* COLUMN_VISIBLE */ GTK_TYPE_ACTION, /* COLUMN_ACTION */ G_TYPE_STRING, /* COLUMN_STOCK_ID */ G_TYPE_STRING, /* COLUMN_LABEL */ G_TYPE_STRING, /* COLUMN_LABEL_CASEFOLD */ G_TYPE_STRING, /* COLUMN_NAME */ G_TYPE_UINT, /* COLUMN_ACCEL_KEY */ GDK_TYPE_MODIFIER_TYPE, /* COLUMN_ACCEL_MASK */ G_TYPE_CLOSURE); /* COLUMN_ACCEL_CLOSURE */ accel_group = gtk_ui_manager_get_accel_group (GTK_UI_MANAGER (manager)); for (list = gtk_ui_manager_get_action_groups (GTK_UI_MANAGER (manager)); list; list = g_list_next (list)) { GimpActionGroup *group = list->data; GList *actions; GList *list2; GtkTreeIter group_iter; gtk_tree_store_append (store, &group_iter, NULL); gtk_tree_store_set (store, &group_iter, GIMP_ACTION_VIEW_COLUMN_STOCK_ID, group->stock_id, GIMP_ACTION_VIEW_COLUMN_LABEL, group->label, -1); actions = gtk_action_group_list_actions (GTK_ACTION_GROUP (group)); actions = g_list_sort (actions, (GCompareFunc) gimp_action_name_compare); for (list2 = actions; list2; list2 = g_list_next (list2)) { GtkAction *action = list2->data; const gchar *name = gtk_action_get_name (action); const gchar *stock_id = gtk_action_get_stock_id (action); gchar *label; gchar *label_casefold; guint accel_key = 0; GdkModifierType accel_mask = 0; GClosure *accel_closure = NULL; GtkTreeIter action_iter; const gchar *tooltip = gtk_action_get_tooltip (action); if (strstr (name, "-menu") || strstr (name, "-popup") || name[0] == '<') continue; label = gimp_strip_uline (gtk_action_get_label (action)); tito_search(name,label,tooltip,action); if (! (label && strlen (label))) { g_free (label); label = g_strdup (name); } label_casefold = g_utf8_casefold (label, -1); if (show_shortcuts) { accel_closure = gtk_action_get_accel_closure (action); if (accel_closure) { GtkAccelKey *key; key = gtk_accel_group_find (accel_group, gimp_action_view_accel_find_func, accel_closure); if (key && key->accel_key && key->accel_flags & GTK_ACCEL_VISIBLE) { accel_key = key->accel_key; accel_mask = key->accel_mods; } } } gtk_tree_store_append (store, &action_iter, &group_iter); gtk_tree_store_set (store, &action_iter, GIMP_ACTION_VIEW_COLUMN_VISIBLE, TRUE, GIMP_ACTION_VIEW_COLUMN_ACTION, action, GIMP_ACTION_VIEW_COLUMN_STOCK_ID, stock_id, GIMP_ACTION_VIEW_COLUMN_LABEL, label, GIMP_ACTION_VIEW_COLUMN_LABEL_CASEFOLD, label_casefold, GIMP_ACTION_VIEW_COLUMN_NAME, name, GIMP_ACTION_VIEW_COLUMN_ACCEL_KEY, accel_key, GIMP_ACTION_VIEW_COLUMN_ACCEL_MASK, accel_mask, GIMP_ACTION_VIEW_COLUMN_ACCEL_CLOSURE, accel_closure, -1); g_free (label); g_free (label_casefold); if (select_action && ! strcmp (select_action, name)) { select_path = gtk_tree_model_get_path (GTK_TREE_MODEL (store), &action_iter); } } g_list_free (actions); } filter = gtk_tree_model_filter_new (GTK_TREE_MODEL (store), NULL); g_object_unref (store); view = g_object_new (GIMP_TYPE_ACTION_VIEW, "model", filter, "rules-hint", TRUE, NULL); g_object_unref (filter); gtk_tree_model_filter_set_visible_column (GTK_TREE_MODEL_FILTER (filter), GIMP_ACTION_VIEW_COLUMN_VISIBLE); GIMP_ACTION_VIEW (view)->manager = g_object_ref (manager); GIMP_ACTION_VIEW (view)->show_shortcuts = show_shortcuts; gtk_tree_view_set_search_column (GTK_TREE_VIEW (view), GIMP_ACTION_VIEW_COLUMN_LABEL); column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, _("Action")); cell = gtk_cell_renderer_pixbuf_new (); gtk_tree_view_column_pack_start (column, cell, FALSE); gtk_tree_view_column_set_attributes (column, cell, "stock-id", GIMP_ACTION_VIEW_COLUMN_STOCK_ID, NULL); cell = gtk_cell_renderer_text_new (); gtk_tree_view_column_pack_start (column, cell, TRUE); gtk_tree_view_column_set_attributes (column, cell, "text", GIMP_ACTION_VIEW_COLUMN_LABEL, NULL); gtk_tree_view_append_column (view, column); if (show_shortcuts) { g_signal_connect (view, "button-press-event", G_CALLBACK (gimp_action_view_button_press), NULL); g_signal_connect (accel_group, "accel-changed", G_CALLBACK (gimp_action_view_accel_changed), view); column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, _("Shortcut")); cell = gtk_cell_renderer_accel_new (); g_object_set (cell, "mode", GTK_CELL_RENDERER_MODE_EDITABLE, "editable", TRUE, NULL); gtk_tree_view_column_pack_start (column, cell, TRUE); gtk_tree_view_column_set_attributes (column, cell, "accel-key", GIMP_ACTION_VIEW_COLUMN_ACCEL_KEY, "accel-mods", GIMP_ACTION_VIEW_COLUMN_ACCEL_MASK, NULL); g_signal_connect (cell, "accel-edited", G_CALLBACK (gimp_action_view_accel_edited), view); g_signal_connect (cell, "accel-cleared", G_CALLBACK (gimp_action_view_accel_cleared), view); gtk_tree_view_append_column (view, column); } column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, _("Name")); cell = gtk_cell_renderer_text_new (); gtk_tree_view_column_pack_start (column, cell, TRUE); gtk_tree_view_column_set_attributes (column, cell, "text", GIMP_ACTION_VIEW_COLUMN_NAME, NULL); gtk_tree_view_append_column (view, column); if (select_path) { gimp_action_view_select_path (GIMP_ACTION_VIEW (view), select_path); gtk_tree_path_free (select_path); } return GTK_WIDGET (view); }