static GtkBuilder *
create_dialog (void)
{
	GtkBuilder   *dialog;
	GtkSizeGroup *size_group;
	GError       *error = NULL;

	dialog = gtk_builder_new ();
	gtk_builder_add_from_file (dialog, MATECC_UI_DIR "/mate-mouse-properties.ui", &error);
	if (error != NULL) {
		g_warning ("Error loading UI file: %s", error->message);
		return NULL;
	}

	size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	gtk_size_group_add_widget (size_group, WID ("acceleration_label"));
	gtk_size_group_add_widget (size_group, WID ("sensitivity_label"));
	gtk_size_group_add_widget (size_group, WID ("threshold_label"));
	gtk_size_group_add_widget (size_group, WID ("timeout_label"));

	size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	gtk_size_group_add_widget (size_group, WID ("acceleration_fast_label"));
	gtk_size_group_add_widget (size_group, WID ("sensitivity_high_label"));
	gtk_size_group_add_widget (size_group, WID ("threshold_large_label"));
	gtk_size_group_add_widget (size_group, WID ("timeout_long_label"));

	size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	gtk_size_group_add_widget (size_group, WID ("acceleration_slow_label"));
	gtk_size_group_add_widget (size_group, WID ("sensitivity_low_label"));
	gtk_size_group_add_widget (size_group, WID ("threshold_small_label"));
	gtk_size_group_add_widget (size_group, WID ("timeout_short_label"));

	return dialog;
}
static void
setup_dialog (GladeXML *dialog, GConfChangeSet *changeset)
{
	GObject *peditor;
	GtkSizeGroup *combobox_size_group;
	GtkSizeGroup *label_size_group;

	gconf_client_add_dir (gconf_client, GST_GCONF_DIR,
			      GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);

	combobox_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);

	gtk_size_group_add_widget (label_size_group, WID ("sounds_playback_label"));
	gtk_size_group_add_widget (label_size_group, WID ("music_playback_label"));
	gtk_size_group_add_widget (label_size_group, WID ("chat_audio_playback_label"));
	gtk_size_group_add_widget (label_size_group, WID ("chat_audio_capture_label"));
	gtk_size_group_add_widget (label_size_group, WID ("mixer_device_label"));
	gtk_size_group_add_widget (combobox_size_group, WID ("sounds_playback_device"));
	gtk_size_group_add_widget (combobox_size_group, WID ("music_playback_device"));
	gtk_size_group_add_widget (combobox_size_group, WID ("chat_audio_playback_device"));
	gtk_size_group_add_widget (combobox_size_group, WID ("chat_audio_capture_device"));

	setup_device_chooser ("", AUDIO_PLAYBACK, WID ("sounds_playback_device"),
			      WID ("sounds_playback_test"),
			      AUDIO_TEST_SOURCE AUDIO_TEST_IN_BETWEEN "gconfaudiosink");
	setup_device_chooser ("music", AUDIO_PLAYBACK, WID ("music_playback_device"),
			      WID ("music_playback_test"),
			      AUDIO_TEST_SOURCE AUDIO_TEST_IN_BETWEEN "gconfaudiosink profile=music");
	setup_device_chooser ("chat", AUDIO_PLAYBACK, WID ("chat_audio_playback_device"),
			      WID ("chat_audio_playback_test"),
			      AUDIO_TEST_SOURCE AUDIO_TEST_IN_BETWEEN "gconfaudiosink profile=chat");
	setup_device_chooser ("", AUDIO_CAPTURE, WID ("chat_audio_capture_device"),
			      WID ("chat_audio_capture_test"),
			      "gconfaudiosrc" AUDIO_TEST_IN_BETWEEN "gconfaudiosink profile=chat");

#ifdef HAVE_ESD
	peditor = gconf_peditor_new_boolean (NULL, ENABLE_ESD_KEY, WID ("enable_toggle"), NULL);
	gconf_peditor_widget_set_guard (GCONF_PROPERTY_EDITOR (peditor), WID ("events_toggle"));
	gconf_peditor_widget_set_guard (GCONF_PROPERTY_EDITOR (peditor), WID ("events_vbox"));
#else
	gtk_widget_hide (WID ("enable_toggle"));
#endif
	gconf_peditor_new_boolean (NULL, EVENT_SOUNDS_KEY, WID ("events_toggle"), NULL);

	gconf_peditor_new_boolean (NULL, AUDIO_BELL_KEY, WID ("bell_audible_toggle"), NULL);

	peditor = gconf_peditor_new_boolean (NULL, VISUAL_BELL_KEY, WID ("bell_visual_toggle"), NULL);
	gconf_peditor_widget_set_guard (GCONF_PROPERTY_EDITOR (peditor), WID ("bell_flash_vbox"));

	/* peditor not so convenient for the radiobuttons */
	gconf_peditor_new_select_radio (NULL,
					VISUAL_BELL_TYPE_KEY,
					gtk_radio_button_get_group (GTK_RADIO_BUTTON (WID ("bell_flash_window_radio"))),
					"conv-to-widget-cb", bell_flash_to_widget,
					"conv-from-widget-cb", bell_flash_from_widget,
					NULL);

	setup_default_mixer (dialog);
}
예제 #3
0
/*!
  \brief load_rt_sliders() is called to load up the runtime slider 
  configuration from the file specified in the firmware's interrogation 
  profile, and populate the gui with the newly created sliders.
  */
G_MODULE_EXPORT void load_rt_sliders(void)
{
	GHashTable *rt_sliders = NULL;
	gchar *filename = NULL;
	xmlDoc * doc = NULL;
	xmlNode *root_element = NULL;
	gboolean res = FALSE;
	gchar *pathstub = NULL;
	Firmware_Details *firmware = NULL;

	firmware = (Firmware_Details *)DATA_GET(global_data,"firmware");

	if (!DATA_GET(global_data,"interrogated"))
	{
		MTXDBG(CRITICAL,_("ERROR, NOT interrogated, returning!\n"));
		return;
	}

	if (DATA_GET(global_data,"leaving"))
	{
		MTXDBG(CRITICAL,_("ERROR, \"leaving\" set, returning!\n"));
		return;
	}
	if (!DATA_GET(global_data,"rtvars_loaded"))
	{
		MTXDBG(CRITICAL,_("CRITICAL ERROR, Realtime Variable definitions NOT LOADED!!!\n"));
		return;
	}
	set_title(g_strdup(_("Loading RT Sliders...")));
	rt_sliders = (GHashTable *)DATA_GET(global_data,"rt_sliders");
	if (!rt_sliders)
	{
		rt_sliders = g_hash_table_new_full(g_str_hash,g_str_equal,g_free,dealloc_slider);
		DATA_SET_FULL(global_data,"rt_sliders",rt_sliders,g_hash_table_destroy);
	}
	pathstub = g_build_filename(RTSLIDERS_DATA_DIR,firmware->sliders_map_file,NULL);
	filename = get_file((const gchar *)DATA_GET(global_data,"project_name"),pathstub,"xml");
	g_free(pathstub);
	LIBXML_TEST_VERSION
		doc = xmlReadFile(filename, NULL, 0);
	g_free(filename);
	if (doc == NULL)
	{
		printf(_("error: could not parse file %s\n"),filename);
		return;
	}
	root_element = xmlDocGetRootElement(doc);
	size_group_left = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	size_group_right = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	res = load_rts_xml_elements(root_element,"rt_rts",rt_sliders,0,RUNTIME_TAB);
	if (!res)
		MTXDBG(CRITICAL,_("Runtime Sliders XML parse/load failure\n"));
	xmlFreeDoc(doc);
	xmlCleanupParser();

	return;
}
예제 #4
0
static GtkWidget *plugin_config_frame(PurplePlugin *plugin) {
	GtkWidget *frame;
	GtkWidget *vbox, *vbox2;
	GtkSizeGroup *sg;
	GtkWidget *dd;

	frame = gtk_vbox_new(FALSE, 18);
	gtk_container_set_border_width(GTK_CONTAINER(frame), 12);

	vbox = pidgin_make_frame(frame, "Inform about unread...");
	sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);

	dd = pidgin_prefs_dropdown(vbox, "LED:",
	                           PURPLE_PREF_STRING,
	                           "/plugins/gtk/ftdi-hwnotify/led-one",
	                           "None", "none",
	                           "Blue", "blue",
	                           "Red", "red",
	                           "Green", "green",
	                           NULL);
	gtk_size_group_add_widget(sg, dd);

	dd = pidgin_prefs_dropdown(vbox, "Instant Messages:",
	                           PURPLE_PREF_STRING,
	                           "/plugins/gtk/ftdi-hwnotify/im",
	                           "Never", "never",
	                           "In hidden conversations", "hidden",
	                           "Always", "always",
	                           NULL);
	gtk_size_group_add_widget(sg, dd);

	dd = pidgin_prefs_dropdown(vbox, "Chat Messages:",
	                        PURPLE_PREF_STRING,
	                        "/plugins/gtk/ftdi-hwnotify/chat",
	                        "Never", "never",
	                        "When my nick is said", "nick",
	                        "Always", "always",
	                        NULL);
	gtk_size_group_add_widget(sg, dd);

        vbox2 = pidgin_make_frame(frame, "Important contacts...");
	sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);

	dd = pidgin_prefs_dropdown(vbox2, "LED:",
	                           PURPLE_PREF_STRING,
	                           "/plugins/gtk/ftdi-hwnotify/led-imp",
	                           "None", "none",
	                           "Blue", "blue",
	                           "Red", "red",
	                           "Green", "green",
	                           NULL);
	gtk_size_group_add_widget(sg, dd);
        pidgin_prefs_labeled_entry (vbox2, "Contacts:", "/plugins/gtk/ftdi-hwnotify/contacts-imp", sg);

	gtk_widget_show_all(frame);
	return frame;
}
예제 #5
0
static void
gs_update_list_init (GsUpdateList *update_list)
{
	GsUpdateListPrivate *priv = GET_PRIV (update_list);
	priv->sizegroup_image = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	priv->sizegroup_name = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);

	gtk_list_box_set_header_func (GTK_LIST_BOX (update_list),
				      list_header_func,
				      update_list, NULL);
	gtk_list_box_set_sort_func (GTK_LIST_BOX (update_list),
				    list_sort_func,
				    update_list, NULL);
}
예제 #6
0
/*!
  \brief load_ve3d_sliders() is called from 3d_vetable.c to load up the sliders
  specific to the 3D Table views. 
  \param table_num is the table number passed to load sliders for
  */
G_MODULE_EXPORT void load_ve3d_sliders(gint table_num)
{
	gchar *filename = NULL;
	xmlDoc * doc = NULL;
	xmlNode *root_element = NULL;
	gboolean res = FALSE;
	GHashTable **ve3d_sliders;
	gchar *pathstub = NULL;
	Firmware_Details *firmware = NULL;

	firmware = (Firmware_Details *)DATA_GET(global_data,"firmware");

	if (!(DATA_GET(global_data,"rtvars_loaded")) || 
			(!(DATA_GET(global_data,"tabs_loaded"))))
	{
		MTXDBG(CRITICAL,_("CRITICAL ERROR, Tabs not loaded OR Realtime Variable definitions NOT LOADED!!!\n"));
		return;
	}

	ve3d_sliders = (GHashTable **)DATA_GET(global_data,"ve3d_sliders");
	if (!ve3d_sliders)
		ve3d_sliders = g_new0(GHashTable *,firmware->total_tables);
	DATA_SET(global_data,"ve3d_sliders",ve3d_sliders);

	if (!ve3d_sliders[table_num])
		ve3d_sliders[table_num] = g_hash_table_new_full(g_str_hash,g_str_equal,g_free,dealloc_slider);

	pathstub = g_build_filename(RTSLIDERS_DATA_DIR,firmware->sliders_map_file,NULL);
	filename = get_file((const gchar *)DATA_GET(global_data,"project_name"),pathstub,"xml");
	g_free(pathstub);
	LIBXML_TEST_VERSION
		doc = xmlReadFile(filename, NULL, 0);
	g_free(filename);
	if (doc == NULL)
	{
		printf(_("error: could not parse file %s\n"),filename);
		return;
	}
	root_element = xmlDocGetRootElement(doc);
	size_group_left = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	size_group_right = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	res = load_rts_xml_elements(root_element,"ve3d_rts",ve3d_sliders[table_num],table_num,VE3D_VIEWER_TAB);
	if (!res)
		MTXDBG(CRITICAL,_("Runtime Sliders XML parse/load failure\n"));
	xmlFreeDoc(doc);
	xmlCleanupParser();

	return;
}
예제 #7
0
파일: pdm-dialog.c 프로젝트: GNOME/galeon
/* Group all Properties and Remove buttons in the same size group to avoid the
 * little jerk you get otherwise when switching pages because one set of
 * buttons is wider than another. */
static void
group_button_allocations (GaleonDialog *dialog)
{
	const gint props[] =
	{
		PROP_COOKIES_REMOVE,
		PROP_COOKIES_REMOVE_BLOCK,
		PROP_PASSWORDS_REMOVE,
		PROP_COOKIE_SITES_REMOVE,
		PROP_IMAGE_SITES_REMOVE,
		PROP_PASSWORD_SITES_REMOVE,
		PROP_POPUP_SITES_REMOVE
	};
	GtkSizeGroup *size_group;
	guint i;

	size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);

	for (i = 0; i < G_N_ELEMENTS (props); ++i)
	{
		GtkWidget *w;
		w = galeon_dialog_get_control (dialog, props[i]);
		gtk_size_group_add_widget (size_group,  w);
	}

	g_object_unref(size_group);
}
예제 #8
0
CEPage *
ce_page_wireless_security_new (NMConnection *connection,
                               GtkWindow *parent_window,
                               NMClient *client,
                               const char **out_secrets_setting_name,
                               GError **error)
{
	CEPageWirelessSecurity *self;
	NMSettingWireless *s_wireless;
	NMSettingWirelessSecurity *s_wsec = NULL;
	NMUtilsSecurityType default_type = NMU_SEC_NONE;
	const char *security;

	s_wireless = nm_connection_get_setting_wireless (connection);
	if (!s_wireless) {
		g_set_error_literal (error, NMA_ERROR, NMA_ERROR_GENERIC, _("Could not load WiFi security user interface; missing WiFi setting."));
		return NULL;
	}

	self = CE_PAGE_WIRELESS_SECURITY (ce_page_new (CE_TYPE_PAGE_WIRELESS_SECURITY,
	                                               connection,
	                                               parent_window,
	                                               client,
	                                               UIDIR "/ce-page-wireless-security.ui",
	                                               "WirelessSecurityPage",
	                                               _("Wireless Security")));
	if (!self) {
		g_set_error_literal (error, NMA_ERROR, NMA_ERROR_GENERIC, _("Could not load WiFi security user interface."));
		return NULL;
	}

	self->group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);

	s_wsec = nm_connection_get_setting_wireless_security (connection);

	security = nm_setting_wireless_get_security (s_wireless);
	if (!security || strcmp (security, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME))
		s_wsec = NULL;
	if (s_wsec)
		default_type = get_default_type_for_security (s_wsec);

	/* Get secrets if the connection is not 802.1x enabled */
	if (   default_type == NMU_SEC_STATIC_WEP
	    || default_type == NMU_SEC_LEAP
	    || default_type == NMU_SEC_WPA_PSK
	    || default_type == NMU_SEC_WPA2_PSK) {
		*out_secrets_setting_name = NM_SETTING_WIRELESS_SECURITY_SETTING_NAME;
	}

	/* Or if it is 802.1x enabled */
	if (   default_type == NMU_SEC_DYNAMIC_WEP
	    || default_type == NMU_SEC_WPA_ENTERPRISE
	    || default_type == NMU_SEC_WPA2_ENTERPRISE) {
		*out_secrets_setting_name = NM_SETTING_802_1X_SETTING_NAME;
	}

	g_signal_connect (self, "initialized", G_CALLBACK (finish_setup), NULL);

	return CE_PAGE (self);
}
예제 #9
0
파일: UgSelector.c 프로젝트: Endz0/uget
// ----------------------------------------------------------------------------
// UgSelectorFilter use UgSelectorFilterData in UgSelectorPage
//
static GtkWidget*	ug_selector_filter_view_init (GtkTreeView* item_view)
{
	GtkSizeGroup*	sizegroup;
	GtkWidget*		widget;
	GtkBox*			vbox;
	GtkBox*			hbox;

	vbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
	// filter view and it's scrolled window
	gtk_widget_set_size_request ((GtkWidget*) item_view, 120, 120);
	widget = gtk_scrolled_window_new (NULL, NULL);
	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (widget),
			GTK_SHADOW_IN);
	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (widget),
			GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
	gtk_container_add (GTK_CONTAINER (widget), GTK_WIDGET (item_view));
	gtk_box_pack_start (vbox, widget, TRUE, TRUE, 2);
	// button
	sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	hbox = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
	gtk_box_pack_start (vbox, (GtkWidget*) hbox, FALSE, FALSE, 2);
	widget = gtk_button_new_with_label (_("All"));
	gtk_size_group_add_widget (sizegroup, widget);
	gtk_box_pack_start (hbox, widget, FALSE, FALSE, 1);
	g_signal_connect (widget, "clicked",
			G_CALLBACK (on_filter_button_all), item_view);
	widget = gtk_button_new_with_label (_("None"));
	gtk_size_group_add_widget (sizegroup, widget);
	gtk_box_pack_start (hbox, widget, FALSE, FALSE, 1);
	g_signal_connect (widget, "clicked",
			G_CALLBACK (on_filter_button_none), item_view);

	return (GtkWidget*) vbox;
}
예제 #10
0
파일: gconf.c 프로젝트: g7/fbpanel
gconf_block *
gconf_block_new(GCallback cb, gpointer data, int indent)
{
    GtkWidget *w;
    gconf_block *b;

    b = g_new0(gconf_block, 1);
    b->cb = cb;
    b->data = data;
    b->main = gtk_hbox_new(FALSE, 0);
    /* indent */
    if (indent > 0)
    {
        w = gtk_hbox_new(FALSE, 0);
        gtk_widget_set_size_request(w, indent, -1);
        gtk_box_pack_start(GTK_BOX(b->main), w, FALSE, FALSE, 0);
    }

    /* area */
    w = gtk_vbox_new(FALSE, 2);
    gtk_box_pack_start(GTK_BOX(b->main), w, FALSE, FALSE, 0);
    b->area = w;

    b->sgr = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
    return b;
}
예제 #11
0
static void
wireless_private_init (CEPageWireless *self)
{
	CEPageWirelessPrivate *priv = CE_PAGE_WIRELESS_GET_PRIVATE (self);
	GladeXML *xml;
	GtkWidget *widget;

	xml = CE_PAGE (self)->xml;

	priv->group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);

	priv->ssid     = GTK_ENTRY (glade_xml_get_widget (xml, "wireless_ssid"));
	priv->bssid    = GTK_ENTRY (glade_xml_get_widget (xml, "wireless_bssid"));
	priv->mac      = GTK_ENTRY (glade_xml_get_widget (xml, "wireless_mac"));
	priv->mode     = GTK_COMBO_BOX (glade_xml_get_widget (xml, "wireless_mode"));
	priv->band     = GTK_COMBO_BOX (glade_xml_get_widget (xml, "wireless_band"));
	priv->channel  = GTK_SPIN_BUTTON (glade_xml_get_widget (xml, "wireless_channel"));

	priv->rate     = GTK_SPIN_BUTTON (glade_xml_get_widget (xml, "wireless_rate"));
	widget = glade_xml_get_widget (xml, "rate_units");
	gtk_size_group_add_widget (priv->group, widget);

	priv->tx_power = GTK_SPIN_BUTTON (glade_xml_get_widget (xml, "wireless_tx_power"));
	widget = glade_xml_get_widget (xml, "tx_power_units");
	gtk_size_group_add_widget (priv->group, widget);

	priv->mtu      = GTK_SPIN_BUTTON (glade_xml_get_widget (xml, "wireless_mtu"));
	widget = glade_xml_get_widget (xml, "mtu_units");
	gtk_size_group_add_widget (priv->group, widget);
}
예제 #12
0
/*! \private
 *  \brief Initialize an options widget instance
 *
 *  \param [in,out] widget The text property widget
 */
static void
instance_init (GschemOptionsWidget *widget)
{
  GtkWidget *vbox;

  g_signal_connect (G_OBJECT (widget),
                    "notify::gschem-toplevel",
                    G_CALLBACK (notify_gschem_toplevel),
                    NULL);

  gtk_container_set_border_width (GTK_CONTAINER (widget),
                                  DIALOG_BORDER_SPACING);

  widget->size_group = gtk_size_group_new (GTK_SIZE_GROUP_BOTH);

  vbox = gtk_vbox_new (FALSE, DIALOG_V_SPACING);
  gtk_container_add (GTK_CONTAINER (widget), vbox);

  gtk_box_pack_start (GTK_BOX (vbox),                          /* box     */
                      create_snap_section (widget),            /* child   */
                      FALSE,                                   /* expand  */
                      FALSE,                                   /* fill    */
                      0);                                      /* padding */

  gtk_box_pack_start (GTK_BOX (vbox),                          /* box     */
                      create_net_section (widget),             /* child   */
                      FALSE,                                   /* expand  */
                      FALSE,                                   /* fill    */
                      0);                                      /* padding */
}
예제 #13
0
static void create_hand_widgets (window_board_t *win)
{
	static const char *alignment_a[] = {"alignment_w", "alignment_n", "alignment_e", "alignment_s"};
	static int dir[] = { 1, 2, 3, 4 };
	int h;
	GtkSizeGroup *sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_BOTH);

	for (h = 0; h < 4; h++) {
		GtkWidget *alignment = get_widget (alignment_a[h]);
		GtkWidget *hand = hand_display_new(HAND_DISPLAY_MODE_HAND);
		gtk_container_add(GTK_CONTAINER(alignment), hand);
		gtk_widget_show(hand);
		g_signal_connect (hand, "card-clicked", G_CALLBACK (card_clicked), dir + h);
		g_signal_connect (hand, "card-enter", G_CALLBACK (card_enter), dir + h);
		g_signal_connect (hand, "card-leave", G_CALLBACK (card_leave), dir + h);
		g_signal_connect (hand, "card-drag-drop", G_CALLBACK (card_drag_drop), dir + h);
		win->handdisp[h] = HAND_DISPLAY(hand);
		hand_display_set_drag (HAND_DISPLAY (hand), 1);
		gtk_size_group_add_widget (sizegroup, hand);
	}
	g_object_unref (sizegroup);

	/* trick display */
	GtkWidget *grid = get_widget ("table1");
	GtkWidget *table = hand_display_new (HAND_DISPLAY_MODE_TABLE);
	gtk_table_attach_defaults (GTK_TABLE (grid), table, 1, 2, 1, 2);
	gtk_widget_show (table);
	win->table = HAND_DISPLAY (table);
}
예제 #14
0
static void
thunar_location_entry_init (ThunarLocationEntry *location_entry)
{
  GtkSizeGroup *size_group;
  GtkWidget    *button;
  GtkWidget    *arrow;

  gtk_box_set_spacing (GTK_BOX (location_entry), 0);
  gtk_container_set_border_width (GTK_CONTAINER (location_entry), 4);

  location_entry->path_entry = thunar_path_entry_new ();
  exo_binding_new (G_OBJECT (location_entry), "current-directory", G_OBJECT (location_entry->path_entry), "current-file");
  g_signal_connect_after (G_OBJECT (location_entry->path_entry), "activate", G_CALLBACK (thunar_location_entry_activate), location_entry);
  gtk_box_pack_start (GTK_BOX (location_entry), location_entry->path_entry, TRUE, TRUE, 0);
  gtk_widget_show (location_entry->path_entry);

  button = gtk_toggle_button_new ();
  g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (thunar_location_entry_button_clicked), location_entry);
  g_signal_connect (G_OBJECT (button), "pressed", G_CALLBACK (thunar_location_entry_button_clicked), location_entry);
  gtk_box_pack_start (GTK_BOX (location_entry), button, FALSE, FALSE, 0);
  gtk_widget_show (button);

  arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
  gtk_container_add (GTK_CONTAINER (button), arrow);
  gtk_widget_show (arrow);

  /* make sure the entry and the button request the same height */
  size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
  gtk_size_group_add_widget (size_group, location_entry->path_entry);
  gtk_size_group_add_widget (size_group, button);
  g_object_unref (G_OBJECT (size_group));
}
예제 #15
0
static void
wifi_private_init (CEPageWifi *self)
{
	CEPageWifiPrivate *priv = CE_PAGE_WIFI_GET_PRIVATE (self);
	GtkBuilder *builder;
	GtkWidget *widget;
	GtkWidget *vbox;
	GtkLabel *label;

	builder = CE_PAGE (self)->builder;

	priv->group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);

	priv->ssid     = GTK_ENTRY (gtk_builder_get_object (builder, "wifi_ssid"));
	priv->cloned_mac = GTK_ENTRY (gtk_builder_get_object (builder, "wifi_cloned_mac"));
	priv->mode     = GTK_COMBO_BOX (gtk_builder_get_object (builder, "wifi_mode"));
	priv->band     = GTK_COMBO_BOX (gtk_builder_get_object (builder, "wifi_band"));
	priv->channel  = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "wifi_channel"));

	/* BSSID */
	priv->bssid = GTK_COMBO_BOX_TEXT (gtk_combo_box_text_new_with_entry ());
	gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (priv->bssid), 0);
	gtk_widget_set_tooltip_text (GTK_WIDGET (priv->bssid),
	                             _("This option locks this connection to the Wi-Fi access point (AP) specified by the BSSID entered here.  Example: 00:11:22:33:44:55"));

	vbox = GTK_WIDGET (gtk_builder_get_object (builder, "wifi_bssid_vbox"));
	gtk_container_add (GTK_CONTAINER (vbox), GTK_WIDGET (priv->bssid));
	gtk_widget_set_halign (GTK_WIDGET (priv->bssid), GTK_ALIGN_FILL);
	gtk_widget_show_all (GTK_WIDGET (priv->bssid));

	/* Device MAC */
	priv->device_combo = GTK_COMBO_BOX_TEXT (gtk_combo_box_text_new_with_entry ());
	gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (priv->device_combo), 0);
	gtk_widget_set_tooltip_text (GTK_WIDGET (priv->device_combo),
	                             _("This option locks this connection to the network device specified "
	                               "either by its interface name or permanent MAC or both. Examples: "
	                               "\"wlan0\", \"3C:97:0E:42:1A:19\", \"wlan0 (3C:97:0E:42:1A:19)\""));

	vbox = GTK_WIDGET (gtk_builder_get_object (builder, "wifi_device_vbox"));
	gtk_container_add (GTK_CONTAINER (vbox), GTK_WIDGET (priv->device_combo));
	gtk_widget_set_halign (GTK_WIDGET (priv->device_combo), GTK_ALIGN_FILL);
	gtk_widget_show_all (GTK_WIDGET (priv->device_combo));

	/* Set mnemonic widget for Device label */
	label = GTK_LABEL (gtk_builder_get_object (builder, "wifi_device_label"));
	gtk_label_set_mnemonic_widget (label, GTK_WIDGET (priv->device_combo));

	priv->rate     = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "wifi_rate"));
	widget = GTK_WIDGET (gtk_builder_get_object (builder, "rate_units"));
	gtk_size_group_add_widget (priv->group, widget);

	priv->tx_power = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "wifi_tx_power"));
	widget = GTK_WIDGET (gtk_builder_get_object (builder, "tx_power_units"));
	gtk_size_group_add_widget (priv->group, widget);

	priv->mtu      = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "wifi_mtu"));
	widget = GTK_WIDGET (gtk_builder_get_object (builder, "mtu_units"));
	gtk_size_group_add_widget (priv->group, widget);
}
예제 #16
0
static gboolean
init_plugin_ui (L2tpPluginUiWidget *self, NMConnection *connection, GError **error)
{
    L2tpPluginUiWidgetPrivate *priv = L2TP_PLUGIN_UI_WIDGET_GET_PRIVATE (self);
    NMSettingVPN *s_vpn;
    GtkWidget *widget;
    const char *value;

    s_vpn = (NMSettingVPN *) nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN);

    priv->group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);

    widget = glade_xml_get_widget (priv->xml, "gateway_entry");
    if (!widget)
        return FALSE;
    gtk_size_group_add_widget (priv->group, widget);
    if (s_vpn) {
        value = nm_setting_vpn_get_data_item (s_vpn, NM_L2TP_KEY_GATEWAY);
        if (value && strlen (value))
            gtk_entry_set_text (GTK_ENTRY (widget), value);
    }
    g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (stuff_changed_cb), self);

    widget = glade_xml_get_widget (priv->xml, "user_entry");
    if (!widget)
        return FALSE;
    gtk_size_group_add_widget (priv->group, widget);
    if (s_vpn) {
        value = nm_setting_vpn_get_data_item (s_vpn, NM_L2TP_KEY_USER);
        if (value && strlen (value))
            gtk_entry_set_text (GTK_ENTRY (widget), value);
    }
    g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (stuff_changed_cb), self);

    widget = glade_xml_get_widget (priv->xml, "domain_entry");
    if (!widget)
        return FALSE;
    gtk_size_group_add_widget (priv->group, widget);
    if (s_vpn) {
        value = nm_setting_vpn_get_data_item (s_vpn, NM_L2TP_KEY_DOMAIN);
        if (value && strlen (value))
            gtk_entry_set_text (GTK_ENTRY (widget), value);
    }
    g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (stuff_changed_cb), self);

    widget = glade_xml_get_widget (priv->xml, "advanced_button");
    g_signal_connect (G_OBJECT (widget), "clicked", G_CALLBACK (advanced_button_clicked_cb), self);

    widget = glade_xml_get_widget (priv->xml, "show_passwords_checkbutton");
    g_return_val_if_fail (widget != NULL, FALSE);
    g_signal_connect (G_OBJECT (widget), "toggled",
                      (GCallback) show_toggled_cb,
                      self);

    fill_vpn_passwords (priv->xml, priv->group, connection, stuff_changed_cb, self);

    return TRUE;
}
예제 #17
0
FormDialog::FormDialog (Ekiga::FormRequestPtr _request,
			GtkWidget *parent): request(_request)
{
  GtkWidget *vbox = NULL;

  rows = 0;
  advanced_rows = 0;

  window = gtk_dialog_new_with_buttons (NULL, GTK_WINDOW (NULL),
                                        GTK_DIALOG_MODAL,
                                        GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                                        GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
                                        NULL);
  if (GTK_IS_WINDOW (parent))
    gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (parent));

  gtk_dialog_set_default_response (GTK_DIALOG (window),
                                   GTK_RESPONSE_ACCEPT);
  gtk_window_set_resizable (GTK_WINDOW (window), FALSE);

  vbox = gtk_vbox_new (FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, FALSE, FALSE, 0);
  gtk_widget_show (vbox);

  preamble = gtk_vbox_new (FALSE, 0);
  gtk_box_pack_start (GTK_BOX (vbox), preamble, FALSE, FALSE, 0);

  fields = gtk_table_new (0, 2, FALSE);
  gtk_table_set_row_spacings (GTK_TABLE (fields), 2);
  gtk_table_set_col_spacings (GTK_TABLE (fields), 2);
  gtk_box_pack_start (GTK_BOX (vbox), fields, FALSE, FALSE, 3);

  advanced_fields = gtk_table_new (0, 2, FALSE);
  gtk_table_set_row_spacings (GTK_TABLE (advanced_fields), 2);
  gtk_table_set_col_spacings (GTK_TABLE (advanced_fields), 2);
  expander = gtk_expander_new (_("Advanced"));
  gtk_container_add (GTK_CONTAINER (expander), advanced_fields);
  gtk_box_pack_start (GTK_BOX (vbox), expander, FALSE, FALSE, 3);

  labels_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
  options_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);

  request->visit (*this);
}
예제 #18
0
static void
pollscaledlg_init(PollScaleDlg *psdlg, GtkWindow *parent) {
	GtkWidget *mainbox, *vbox;
	GtkWidget *label;
	GtkSizeGroup *sizegroup;

	GtkAdjustment *adj1 = (GtkAdjustment*)gtk_adjustment_new(
			1.0,  -32000.0, 32000.0, 1.0, 5.0, 0);
	GtkAdjustment *adj2 = (GtkAdjustment*)gtk_adjustment_new(
			10.0, -32000.0, 32000.0, 1.0, 5.0, 0);
	GtkAdjustment *adj3 = (GtkAdjustment*)gtk_adjustment_new(
			1.0,  -32000.0, 32000.0, 1.0, 5.0, 0);

	psdlg->dlg = gtk_dialog_new_with_buttons(_("Scale Poll Question"),
			parent, GTK_DIALOG_MODAL,
			GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
			GTK_STOCK_OK, GTK_RESPONSE_OK,
			NULL);
	jam_win_set_size(GTK_WINDOW(psdlg->dlg), 400, -1);

	mainbox = gtk_hbox_new(FALSE, 12);

	vbox = gtk_vbox_new(FALSE, 6);
	label = gtk_label_new_with_mnemonic(_("_Question:"));
	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);

	psdlg->question = gtk_text_view_new();
	gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(psdlg->question), GTK_WRAP_WORD);
	gtk_label_set_mnemonic_widget(GTK_LABEL(label), psdlg->question);
	gtk_box_pack_start(GTK_BOX(vbox),
			scroll_wrap(psdlg->question),
			TRUE, TRUE, 0);

	gtk_box_pack_start(GTK_BOX(mainbox), vbox, TRUE, TRUE, 0);

	vbox = gtk_vbox_new(FALSE, 6);
	sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);

	psdlg->from = gtk_spin_button_new(adj1, 1.0, 0);
	gtk_box_pack_start(GTK_BOX(vbox),
			labelled_box_new_sg(_("_From:"), psdlg->from, sizegroup),
			FALSE, FALSE, 0);
	psdlg->to = gtk_spin_button_new(adj2, 1.0, 0);
	gtk_box_pack_start(GTK_BOX(vbox),
			labelled_box_new_sg(_("_To:"), psdlg->to, sizegroup),
			FALSE, FALSE, 0);
	psdlg->by = gtk_spin_button_new(adj3, 1.0, 0);
	gtk_box_pack_start(GTK_BOX(vbox),
			labelled_box_new_sg(_("_By:"), psdlg->by, sizegroup),
			FALSE, FALSE, 0);

	gtk_box_pack_start(GTK_BOX(mainbox), vbox, FALSE, FALSE, 0);

	jam_dialog_set_contents(GTK_DIALOG(psdlg->dlg), mainbox);
}
예제 #19
0
파일: pidginrc.c 프로젝트: Draghtnod/pidgin
static GtkWidget *
purplerc_make_fonts_vbox(void)
{
	GtkWidget *vbox = NULL, *hbox = NULL, *check = NULL, *widget = NULL;
	GtkSizeGroup *labelsg = NULL;
	gsize i;

	vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
	labelsg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);

	gtk_container_set_border_width(GTK_CONTAINER(vbox), PIDGIN_HIG_BORDER);

	hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);

	check = pidgin_prefs_checkbox(_("GTK+ Interface Font"),
	                              "/plugins/gtk/purplerc/set/gtk-font-name",
	                              hbox);
	gtk_size_group_add_widget(labelsg, check);

	widget = pidgin_pixbuf_button_from_stock("", GTK_STOCK_SELECT_FONT,
	                                         PIDGIN_BUTTON_HORIZONTAL);
	gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, FALSE, 0);
	gtk_widget_set_sensitive(widget,
	                         purple_prefs_get_bool("/plugins/gtk/purplerc/set/gtk-font-name"));
	g_signal_connect(G_OBJECT(check), "toggled",
	                 G_CALLBACK(pidgin_toggle_sensitive), widget);
	g_signal_connect(G_OBJECT(widget), "clicked",
	                 G_CALLBACK(purplerc_set_font), GINT_TO_POINTER(-1));

	for (i = 0; i < G_N_ELEMENTS(font_prefs); i++) {
		hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
		gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);

		check = pidgin_prefs_checkbox(_(font_names[i]),
		                              font_prefs_set[i], hbox);
		gtk_size_group_add_widget(labelsg, check);

		font_widgets[i] = pidgin_pixbuf_button_from_stock("",
				GTK_STOCK_SELECT_FONT, PIDGIN_BUTTON_HORIZONTAL);
		gtk_box_pack_start(GTK_BOX(hbox), font_widgets[i], FALSE,
		                   FALSE, 0);
		gtk_widget_set_sensitive(font_widgets[i],
		                         purple_prefs_get_bool(font_prefs_set[i]));
		g_signal_connect(G_OBJECT(check), "toggled",
		                 G_CALLBACK(pidgin_toggle_sensitive),
		                 font_widgets[i]);
		g_signal_connect(G_OBJECT(font_widgets[i]), "clicked",
		                 G_CALLBACK(purplerc_set_font),
		                 GINT_TO_POINTER(i));
	}

	g_object_unref(labelsg);

	return vbox;
}
static GtkBuilder *
create_dialog (void)
{
	GtkBuilder *dialog;
	GtkSizeGroup *size_group;
	GtkWidget *image;
	GError *error = NULL;
	static const gchar *uifile = MATECC_UI_DIR "/mate-keyboard-properties-dialog.ui";

	dialog = gtk_builder_new ();
	if (gtk_builder_add_from_file (dialog, uifile, &error) == 0) {
		g_warning ("Could not load UI: %s", error->message);
		g_error_free (error);
		g_object_unref (dialog);
		return NULL;
	}

	size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	gtk_size_group_add_widget (size_group, WID ("repeat_slow_label"));
	gtk_size_group_add_widget (size_group, WID ("delay_short_label"));
	gtk_size_group_add_widget (size_group, WID ("blink_slow_label"));
	g_object_unref (G_OBJECT (size_group));

	size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	gtk_size_group_add_widget (size_group, WID ("repeat_fast_label"));
	gtk_size_group_add_widget (size_group, WID ("delay_long_label"));
	gtk_size_group_add_widget (size_group, WID ("blink_fast_label"));
	g_object_unref (G_OBJECT (size_group));

	size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	gtk_size_group_add_widget (size_group, WID ("repeat_delay_scale"));
	gtk_size_group_add_widget (size_group, WID ("repeat_speed_scale"));
	gtk_size_group_add_widget (size_group, WID ("cursor_blink_time_scale"));
	g_object_unref (G_OBJECT (size_group));

	image = gtk_image_new_from_stock (GTK_STOCK_ADD, GTK_ICON_SIZE_BUTTON);
	gtk_button_set_image (GTK_BUTTON (WID ("xkb_layouts_add")), image);

	image = gtk_image_new_from_stock (GTK_STOCK_REFRESH, GTK_ICON_SIZE_BUTTON);
	gtk_button_set_image (GTK_BUTTON (WID ("xkb_reset_to_defaults")), image);

	return dialog;
}
예제 #21
0
GtkSizeGroup *
gimp_image_map_tool_dialog_get_label_group (GimpImageMapTool *tool)
{
  g_return_val_if_fail (GIMP_IS_IMAGE_MAP_TOOL (tool), NULL);

  if (! tool->label_group)
    tool->label_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);

  return tool->label_group;
}
예제 #22
0
파일: common-gtk.c 프로젝트: na4zagin3/uim
static GtkWidget *
toolbar_new(gint type)
{
    GtkWidget *button;
    GtkWidget *hbox;
    GList *prop_buttons = NULL;
    GtkSizeGroup *sg;

    /*
     * Set uim-toolbar-save-default-im? #t in ~/.uim enable this if you'd like to
     * save default IM into ~/.uim.d/custom/custom-global.scm upon system global
     * IM switch.  However, using uim-custom consumes quite amount of memory, and
     * requires additional startup time.
     */
    if (uim_scm_symbol_value_bool("uim-toolbar-save-default-im?"))
        custom_enabled = (gboolean)uim_custom_enable();

    helper_toolbar_check_custom();
    init_icon();

    /* create widgets */
#if GTK_CHECK_VERSION(3, 2, 0)
    hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
#else
    hbox = gtk_hbox_new(FALSE, 0);
#endif

    im_menu = gtk_menu_new();
    prop_menu = gtk_menu_new();
    right_click_menu = right_click_menu_create();
    sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);

    /* prop menu button */
    button = button_create(hbox, sg, "uim-icon", " x", type);

    gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);

    prop_buttons = g_list_append(prop_buttons, button);

    g_object_set_data(G_OBJECT(hbox), OBJECT_DATA_PROP_BUTTONS, prop_buttons);
    g_object_set_data(G_OBJECT(hbox), OBJECT_DATA_SIZE_GROUP, sg);
    g_object_set_data(G_OBJECT(hbox), OBJECT_DATA_TOOLBAR_TYPE,
                      GINT_TO_POINTER(type));

    uim_fd = -1;

    if (type != TYPE_ICON) {
        /* delay initialization until getting "embedded" signal */
        uim_toolbar_check_helper_connection(hbox);
        uim_helper_client_get_prop_list();
        uim_toolbar_get_im_list();
    }

    return hbox;
}
예제 #23
0
GtkWidget *
do_offscreen_window2 (GtkWidget *do_widget)
{
  if (!window)
    {
      GtkWidget *bin, *vbox;
      GtkWidget *hbox, *entry, *applybutton, *backbutton;
      GtkSizeGroup *group;

      window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
      gtk_window_set_screen (GTK_WINDOW (window),
                             gtk_widget_get_screen (do_widget));
      gtk_window_set_title (GTK_WINDOW (window), "Effects");

      g_signal_connect (window, "destroy",
                        G_CALLBACK (gtk_widget_destroyed), &window);

      gtk_container_set_border_width (GTK_CONTAINER (window), 10);

      vbox = gtk_vbox_new (0, FALSE);

      bin = gtk_mirror_bin_new ();

      group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);

      hbox = gtk_hbox_new (FALSE, 6);
      backbutton = gtk_button_new ();
      gtk_container_add (GTK_CONTAINER (backbutton),
                         gtk_image_new_from_stock (GTK_STOCK_GO_BACK, 4));
      gtk_size_group_add_widget (group, backbutton);
      entry = gtk_entry_new ();
      gtk_size_group_add_widget (group, entry);
      applybutton = gtk_button_new ();
      gtk_size_group_add_widget (group, applybutton);
      gtk_container_add (GTK_CONTAINER (applybutton),
                         gtk_image_new_from_stock (GTK_STOCK_APPLY, 4));

      gtk_container_add (GTK_CONTAINER (window), vbox);
      gtk_box_pack_start (GTK_BOX (vbox), bin, TRUE, TRUE, 0);
      gtk_container_add (GTK_CONTAINER (bin), hbox);
      gtk_box_pack_start (GTK_BOX (hbox), backbutton, FALSE, FALSE, 0);
      gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
      gtk_box_pack_start (GTK_BOX (hbox), applybutton, FALSE, FALSE, 0);
    }

  if (!gtk_widget_get_visible (window))
    gtk_widget_show_all (window);
  else
    {
      gtk_widget_destroy (window);
      window = NULL;
    }

  return window;
}
예제 #24
0
static void
gs_update_list_init (GsUpdateList *update_list)
{
	GsUpdateListPrivate *priv = gs_update_list_get_instance_private (update_list);
	priv->sizegroup_image = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	priv->sizegroup_name = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	priv->sizegroup_button = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	priv->sizegroup_header = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);

	gtk_list_box_set_header_func (GTK_LIST_BOX (update_list),
				      list_header_func,
				      update_list, NULL);
	gtk_list_box_set_sort_func (GTK_LIST_BOX (update_list),
				    list_sort_func,
				    update_list, NULL);

	/* set each section count to zero */
	for (guint i = 0; i < GS_UPDATE_LIST_SECTION_LAST; i++)
		priv->sections_cnt[i] = 0;
}
예제 #25
0
static void
cheese_avatar_widget_init (CheeseAvatarWidget *widget)
{
    CheeseAvatarWidgetPrivate *priv;
    GtkWidget *frame;
    GtkWidget *image;

    priv = cheese_avatar_widget_get_instance_private (widget);

    priv->flash = cheese_flash_new (GTK_WIDGET (widget));

    priv->notebook = gtk_notebook_new ();
    g_object_set(G_OBJECT (priv->notebook), "margin", 12, NULL);
    gtk_notebook_set_show_border (GTK_NOTEBOOK (priv->notebook), FALSE);
    gtk_notebook_set_show_tabs (GTK_NOTEBOOK (priv->notebook), FALSE);

    gtk_container_add (GTK_CONTAINER (widget), priv->notebook);

    /* Camera tab */
    priv->camera = cheese_widget_new ();
    g_signal_connect (G_OBJECT (priv->camera), "notify::state",
                      G_CALLBACK (state_change_cb), widget);
    image = gtk_image_new_from_icon_name ("camera-photo-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR);
    priv->take_button = gtk_button_new ();
    gtk_button_set_image (GTK_BUTTON (priv->take_button), image);
    g_signal_connect (G_OBJECT (priv->take_button), "clicked",
                      G_CALLBACK (take_button_clicked_cb), widget);
    gtk_widget_set_sensitive (priv->take_button, FALSE);
    gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook),
                              create_page (priv->camera, priv->take_button),
                              gtk_label_new ("webcam"));

    /* Image tab */
    priv->image = um_crop_area_new ();
    frame = gtk_frame_new (NULL);
    gtk_container_add (GTK_CONTAINER (frame), priv->image);
    gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
    priv->take_again_button = gtk_button_new_with_mnemonic (_("_Take Another Picture"));
    g_signal_connect (G_OBJECT (priv->take_again_button), "clicked",
                      G_CALLBACK (take_again_button_clicked_cb), widget);
    gtk_widget_set_sensitive (priv->take_again_button, FALSE);
    gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook),
                              create_page (frame, priv->take_again_button),
                              gtk_label_new ("image"));

    priv->sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
    gtk_size_group_add_widget (priv->sizegroup, priv->take_button);
    gtk_size_group_add_widget (priv->sizegroup, priv->take_again_button);

    gtk_widget_show_all (GTK_WIDGET (widget));
}
static void
create_dialog (CcMousePropertiesPrivate *d)
{
	GtkSizeGroup *size_group;

	size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	gtk_size_group_add_widget (size_group, WID ("primary_button_label"));
	gtk_size_group_add_widget (size_group, WID ("pointer_speed_label"));
	gtk_size_group_add_widget (size_group, WID ("double_click_label"));
	gtk_size_group_add_widget (size_group, WID ("touchpad_pointer_speed_label"));

	size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	gtk_size_group_add_widget (size_group, WID ("pointer_speed_fast_label"));
	gtk_size_group_add_widget (size_group, WID ("double_click_fast_label"));
	gtk_size_group_add_widget (size_group, WID ("touchpad_pointer_speed_fast_label"));

	size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	gtk_size_group_add_widget (size_group, WID ("pointer_speed_slow_label"));
	gtk_size_group_add_widget (size_group, WID ("double_click_slow_label"));
	gtk_size_group_add_widget (size_group, WID ("touchpad_pointer_speed_slow_label"));

	gtk_widget_set_direction (WID ("primary_button_box"), GTK_TEXT_DIR_LTR);
}
예제 #27
0
static void
impl_constructed (GObject *object)
{
	RBButtonBar *bar;

	RB_CHAIN_GOBJECT_METHOD (rb_button_bar_parent_class, constructed, object);

	bar = RB_BUTTON_BAR (object);

	bar->priv->size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);

	bar->priv->handlers = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_object_unref);

	build_button_bar (bar);
}
예제 #28
0
파일: gtk-utils.c 프로젝트: ejona86/quarry
GtkSizeGroup *
gtk_utils_align_left_widgets (GtkContainer *container,
			      GtkSizeGroup *size_group)
{
  g_return_val_if_fail (GTK_IS_CONTAINER (container), NULL);
  g_return_val_if_fail (!size_group || GTK_IS_SIZE_GROUP (size_group), NULL);

  if (!size_group)
    size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);

  gtk_container_foreach (container,
			 (GtkCallback) do_align_left_widgets, size_group);

  return size_group;
}
예제 #29
0
파일: mixer.c 프로젝트: DeforaOS/Mixer
void mixer_properties(Mixer * mixer)
{
	GtkSizeGroup * group;
	GtkWidget * vbox;
	GtkWidget * hbox;
	MixerProperties mp;

	if(mixer->properties != NULL)
	{
		gtk_widget_show(mixer->properties);
		return;
	}
	if(mixer_get_properties(mixer, &mp) != 0)
		return;
	mixer->properties = gtk_message_dialog_new(GTK_WINDOW(mixer->window),
			GTK_DIALOG_DESTROY_WITH_PARENT,
			GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
#if GTK_CHECK_VERSION(2, 6, 0)
			"%s", _("Properties"));
	gtk_message_dialog_format_secondary_text(
			GTK_MESSAGE_DIALOG(mixer->properties),
#endif
			"");
#if GTK_CHECK_VERSION(2, 10, 0)
	gtk_message_dialog_set_image(GTK_MESSAGE_DIALOG(mixer->properties),
			gtk_image_new_from_icon_name("gtk-properties",
				GTK_ICON_SIZE_DIALOG));
#endif
	gtk_window_set_title(GTK_WINDOW(mixer->properties), _("Properties"));
	g_signal_connect(mixer->properties, "delete-event", G_CALLBACK(
				_properties_on_closex), NULL);
	g_signal_connect(mixer->properties, "response", G_CALLBACK(
				gtk_widget_hide), NULL);
#if GTK_CHECK_VERSION(2, 14, 0)
	vbox = gtk_dialog_get_content_area(GTK_DIALOG(mixer->properties));
#else
	vbox = GTK_DIALOG(mixer->properties)->vbox;
#endif
	group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
	hbox = _properties_label(mixer, group, _("Name: "), mp.name);
	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 2);
	hbox = _properties_label(mixer, group, _("Version: "), mp.version);
	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0);
	hbox = _properties_label(mixer, group, _("Device: "), mp.device);
	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 2);
	gtk_widget_show_all(vbox);
	gtk_widget_show(mixer->properties);
}
예제 #30
0
static GtkWidget*
proxyuserpass() {
    GtkWidget *vbox;
    GtkSizeGroup *sg;

    vbox = gtk_vbox_new(FALSE, 6);

    sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);

    gtk_box_pack_start(GTK_BOX(vbox),
                       sw_make_sg("net_proxyuser", sg), FALSE, FALSE, 0);
    gtk_box_pack_start(GTK_BOX(vbox),
                       sw_make_sg("net_proxypass", sg), FALSE, FALSE, 0);

    return vbox;
}