/**
 * go_combo_box_popup_hide:
 * @combo: a #GOComboBox
 *
 * Hides popup, but not when it is torn off.
 * This is the external interface - for subclasses and apps which expect a
 * regular combo which doesn't do tearoffs.
 */
/* protected */ void
go_combo_box_popup_hide (GOComboBox *combo_box)
{
	if (!combo_box->priv->torn_off)
		go_combo_box_popup_hide_unconditional (combo_box);
	else if (gtk_widget_get_visible(combo_box->priv->toplevel)) {
		/* Both popup and tearoff window present. Get rid of just
                   the popup shell. */
		go_combo_popup_tear_off (combo_box, FALSE);
		set_arrow_state (combo_box, FALSE);
	}
}
Esempio n. 2
0
static gboolean
cb_arrow_pressed (GOComboBox *combo_box)
{
	if (!combo_box->priv->updating_buttons) {
		if (combo_box->priv->toplevel == NULL ||
		    !GTK_WIDGET_VISIBLE (combo_box->priv->toplevel))
			go_combo_box_popup_display (combo_box);
		else
			go_combo_box_popup_hide_unconditional (combo_box);
	}

	return TRUE;
}
static gboolean
cb_arrow_pressed (GOComboBox *combo_box)
{
	if (!combo_box->priv->updating_buttons) {
		if (combo_box->priv->toplevel == NULL ||
		    !gtk_widget_get_visible (combo_box->priv->toplevel))
			go_combo_box_popup_display (combo_box);
		else
			go_combo_box_popup_hide_unconditional (combo_box);
	}

	return TRUE;
}
static gboolean
cb_tearable_button_release (GtkWidget *w, G_GNUC_UNUSED GdkEventButton *event,
			    GOComboBox *combo)
{
	g_return_val_if_fail (w != NULL, FALSE);
	g_return_val_if_fail (GTK_IS_TEAROFF_MENU_ITEM (w), FALSE);

	/* FIXME: should we notify the parent menu? */

	if (!combo->priv->torn_off) {
		gboolean need_connect;

		need_connect = (!combo->priv->tearoff_window);
		go_combo_set_tearoff_state (combo, TRUE);
		if (need_connect)
			g_signal_connect_swapped (combo->priv->tearoff_window,
				"delete_event",
				G_CALLBACK (cb_popup_delete), combo);
	} else
		go_combo_box_popup_hide_unconditional (combo);

	return TRUE;
}
Esempio n. 5
0
static gboolean
cb_popup_delete (GOComboBox *combo)
{
	go_combo_box_popup_hide_unconditional (combo);
	return TRUE;
}