static void cb_toolbar_reconfigured (GOToolComboPixmaps *tool, GtkAction *a) { GtkOrientation o = gtk_tool_item_get_orientation (GTK_TOOL_ITEM (tool)); GtkReliefStyle relief = gtk_tool_item_get_relief_style (GTK_TOOL_ITEM (tool)); GOActionComboPixmaps *paction = (GOActionComboPixmaps *)a; GOActionComboPixmapsElement const *el = paction->elements; g_object_set (G_OBJECT (tool->combo), "show-arrow", o == GTK_ORIENTATION_HORIZONTAL, NULL); go_combo_pixmaps_clear_elements (tool->combo); for ( ; el->stock_id != NULL ; el++) { GdkPixbuf *icon = make_icon (a, el->stock_id, GTK_WIDGET (tool)); /* * FIXME FIXME FIXME: we must find a better solution for * translating strings not in goffice domain */ go_combo_pixmaps_add_element (tool->combo, icon, el->id, gettext (el->untranslated_tooltip)); } go_combo_pixmaps_select_id (tool->combo, paction->selected_id); go_combo_box_set_relief (GO_COMBO_BOX (tool->combo), relief); }
static gboolean go_combo_box_mnemonic_activate (GtkWidget *w, gboolean group_cycling) { GOComboBox *combo_box = GO_COMBO_BOX (w); cb_arrow_pressed (combo_box); return TRUE; }
static void go_combo_box_finalize (GObject *object) { GOComboBox *combo_box = GO_COMBO_BOX (object); g_free (combo_box->priv); go_combo_box_parent_class->finalize (object); }
static void go_combo_box_style_set (GtkWidget *widget, G_GNUC_UNUSED GtkStyle *prev_style) { gboolean add_tearoffs; gtk_widget_style_get (widget, "add-tearoffs", &add_tearoffs, NULL); go_combo_box_set_tearable (GO_COMBO_BOX (widget), add_tearoffs); }
/* protected */ void go_combo_box_popup_display (GOComboBox *combo_box) { int x, y; g_return_if_fail (GO_COMBO_BOX (combo_box) != NULL); g_return_if_fail (combo_box->priv->popdown_container != NULL); if (combo_box->priv->torn_off) { /* To give the illusion that tearoff still displays the * popup, we copy the image in the popup window to the * background. Thus, it won't be blank after reparenting */ go_combo_tearoff_bg_copy (combo_box); /* We force an unrealize here so that we don't trigger * redrawing/ clearing code - we just want to reveal our * backing pixmap. */ go_combo_popup_reparent (combo_box->priv->popup, combo_box->priv->toplevel, TRUE); } go_combo_box_get_pos (combo_box, &x, &y); gtk_window_move (GTK_WINDOW (combo_box->priv->toplevel), x, y); gtk_widget_realize (combo_box->priv->popup); gtk_widget_show (combo_box->priv->popup); gtk_widget_realize (combo_box->priv->toplevel); gtk_widget_show (combo_box->priv->toplevel); gtk_widget_grab_focus (combo_box->priv->toplevel); do_focus_change (combo_box->priv->toplevel, TRUE); gtk_grab_add (combo_box->priv->toplevel); gdk_device_grab (gtk_get_current_event_device (), gtk_widget_get_window (combo_box->priv->toplevel), GDK_OWNERSHIP_APPLICATION, TRUE, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK, NULL, GDK_CURRENT_TIME); set_arrow_state (combo_box, TRUE); }
static void go_combo_box_destroy (GtkObject *object) { GtkObjectClass *klass = (GtkObjectClass *)go_combo_box_parent_class; GOComboBox *combo_box = GO_COMBO_BOX (object); if (combo_box->priv->toplevel) { gtk_widget_destroy (combo_box->priv->toplevel); g_object_unref (combo_box->priv->toplevel); combo_box->priv->toplevel = NULL; } if (combo_box->priv->tearoff_window) { gtk_widget_destroy (combo_box->priv->tearoff_window); g_object_unref (combo_box->priv->tearoff_window); combo_box->priv->tearoff_window = NULL; } if (klass->destroy) klass->destroy (object); }