static gboolean search_entry_key_press_event_cb (GtkEntry *entry, GdkEventKey *event, GnomeControlCenterPrivate *priv) { if (event->keyval == GDK_KEY_Return) { GtkTreePath *path; path = gtk_tree_path_new_first (); priv->last_time = event->time; gtk_icon_view_item_activated (GTK_ICON_VIEW (priv->search_view), path); gtk_tree_path_free (path); return TRUE; } if (event->keyval == GDK_KEY_Escape) { gtk_entry_set_text (entry, ""); return TRUE; } return FALSE; }
JNIEXPORT void JNICALL Java_org_gnome_gtk_GtkIconView_gtk_1icon_1view_1item_1activated ( JNIEnv* env, jclass cls, jlong _self, jlong _path ) { GtkIconView* self; GtkTreePath* path; // convert parameter self self = (GtkIconView*) _self; // convert parameter path path = (GtkTreePath*) _path; // call function gtk_icon_view_item_activated(self, path); // cleanup parameter self // cleanup parameter path }
static gboolean idle_do_action (gpointer data) { GtkIconViewItemAccessible *item; GtkIconView *icon_view; GtkTreePath *path; item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (data); item->action_idle_handler = 0; if (item->widget != NULL) { icon_view = GTK_ICON_VIEW (item->widget); path = gtk_tree_path_new_from_indices (item->item->index, -1); gtk_icon_view_item_activated (icon_view, path); gtk_tree_path_free (path); } return FALSE; }
/** * ppg_add_instrument_dialog_response: * @dialog: (in): A #PpgAddInstrumentDialog. * @response_id: (in): The dialog response id. * * Handle the "response" signal for the dialog. If @response_id is * GTK_RESPONSE_OK, then the currently selected item is added to the session. * * The signal is also blocked if it was handled. * * Returns: None. * Side effects: None. */ static void ppg_add_instrument_dialog_response (PpgAddInstrumentDialog *dialog, gint response_id, gpointer user_data) { PpgAddInstrumentDialogPrivate *priv; GList *list; g_return_if_fail(PPG_IS_ADD_INSTRUMENT_DIALOG(dialog)); priv = dialog->priv; if (response_id == GTK_RESPONSE_OK) { g_signal_stop_emission_by_name(dialog, "response"); list = gtk_icon_view_get_selected_items(GTK_ICON_VIEW(priv->icon_view)); if (list) { gtk_icon_view_item_activated(GTK_ICON_VIEW(priv->icon_view), list->data); } g_list_foreach(list, (GFunc)gtk_tree_path_free, NULL); g_list_free(list); gtk_widget_grab_focus(priv->entry); } }
static VALUE iview_item_activated(VALUE self, VALUE path) { gtk_icon_view_item_activated(_SELF(self), RVAL2GTKTREEPATH(path)); return self; }