本文整理汇总了C++中WID函数的典型用法代码示例。如果您正苦于以下问题:C++ WID函数的具体用法?C++ WID怎么用?C++ WID使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了WID函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: keyboard_general_init
void
keyboard_general_init (CcPanel *panel, GtkBuilder *builder)
{
if (keyboard_settings == NULL)
keyboard_settings = g_settings_new ("org.gnome.desktop.peripherals.keyboard");
if (interface_settings == NULL)
interface_settings = g_settings_new ("org.gnome.desktop.interface");
g_settings_bind (keyboard_settings, "repeat",
WID ("repeat_toggle"), "active",
G_SETTINGS_BIND_DEFAULT);
g_settings_bind (keyboard_settings, "repeat",
WID ("repeat_grid"), "sensitive",
G_SETTINGS_BIND_GET);
g_settings_bind (keyboard_settings, "delay",
gtk_range_get_adjustment (GTK_RANGE (WID ("repeat_delay_scale"))), "value",
G_SETTINGS_BIND_DEFAULT);
g_settings_bind_with_mapping (keyboard_settings, "repeat-interval",
gtk_range_get_adjustment (GTK_RANGE (WID ("repeat_speed_scale"))), "value",
G_SETTINGS_BIND_DEFAULT,
get_rate, set_rate, NULL, NULL);
g_settings_bind (interface_settings, "cursor-blink",
WID ("cursor_toggle"), "active",
G_SETTINGS_BIND_DEFAULT);
g_settings_bind (interface_settings, "cursor-blink",
WID ("cursor_grid"), "sensitive",
G_SETTINGS_BIND_GET);
g_settings_bind (interface_settings, "cursor-blink-time",
gtk_range_get_adjustment (GTK_RANGE (WID ("cursor_blink_time_scale"))), "value",
G_SETTINGS_BIND_DEFAULT);
g_signal_connect (WID ("linkbutton"), "activate-link",
G_CALLBACK (layout_link_clicked), panel);
}
示例2: cc_ua_panel_init_seeing
static void
cc_ua_panel_init_seeing (CcUaPanel *self)
{
CcUaPanelPrivate *priv = self->priv;
g_settings_bind_with_mapping (priv->interface_settings, KEY_GTK_THEME,
WID (priv->builder, "seeing_contrast_switch"),
"active", G_SETTINGS_BIND_DEFAULT,
get_contrast_mapping,
set_contrast_mapping,
priv->interface_settings,
NULL);
g_settings_bind_with_mapping (priv->interface_settings, KEY_TEXT_SCALING_FACTOR,
WID (priv->builder, "seeing_large_text_switch"),
"active", G_SETTINGS_BIND_DEFAULT,
get_large_text_mapping,
set_large_text_mapping,
priv->interface_settings,
NULL);
g_settings_bind (priv->kb_settings, "togglekeys-enable",
WID (priv->builder, "seeing_toggle_keys_switch"), "active",
G_SETTINGS_BIND_DEFAULT);
priv->shell_watch_id = g_bus_watch_name (G_BUS_TYPE_SESSION,
"org.gnome.Shell",
G_BUS_NAME_WATCHER_FLAGS_NONE,
(GBusNameAppearedCallback) shell_appeared_cb,
(GBusNameVanishedCallback) shell_vanished_cb,
self,
NULL);
g_signal_connect (WID (priv->builder, "seeing_zoom_preferences_button"),
"clicked",
G_CALLBACK (zoom_options_launch_cb), self);
g_settings_bind (priv->application_settings, "screen-magnifier-enabled",
WID (priv->builder, "seeing_zoom_switch"), "active",
G_SETTINGS_BIND_DEFAULT);
settings_on_off_editor_new (priv, priv->application_settings,
"screen-reader-enabled",
WID (priv->builder, "seeing_reader_switch"),
NULL);
cc_ua_panel_set_shortcut_label (self, "seeing_zoom_enable_keybinding_label", "magnifier");
cc_ua_panel_set_shortcut_label (self, "seeing_zoom_in_keybinding_label", "magnifier-zoom-in");
cc_ua_panel_set_shortcut_label (self, "seeing_zoom_out_keybinding_label", "magnifier-zoom-out");
cc_ua_panel_set_shortcut_label (self, "seeing_reader_enable_keybinding_label", "screenreader");
}
示例3: xkb_options_popup_dialog
/* Create popup dialog */
void
xkb_options_popup_dialog (GtkBuilder * dialog)
{
GtkWidget *chooser;
chooser_dialog = gtk_builder_new ();
gtk_builder_set_translation_domain (chooser_dialog, GETTEXT_PACKAGE);
gtk_builder_add_from_file (chooser_dialog, SAGARMATHACC_UI_DIR
"/sagarmatha-region-panel-options-dialog.ui",
NULL);
chooser = CWID ("xkb_options_dialog");
gtk_window_set_transient_for (GTK_WINDOW (chooser),
GTK_WINDOW (gtk_widget_get_toplevel (WID ("region_notebook"))));
gtk_window_set_modal (GTK_WINDOW (chooser), TRUE);
xkb_options_load_options (chooser_dialog);
g_signal_connect (chooser, "response",
G_CALLBACK (chooser_response_cb), dialog);
gtk_widget_show (chooser);
}
示例4: xkb_options_popup_dialog
/* Create popup dialog */
void
xkb_options_popup_dialog (GtkBuilder * dialog)
{
GtkWidget *chooser;
chooser_dialog = gtk_builder_new ();
gtk_builder_add_from_file (chooser_dialog, MATECC_UI_DIR
"/mate-keyboard-properties-options-dialog.ui",
NULL);
chooser = CWID ("xkb_options_dialog");
gtk_window_set_transient_for (GTK_WINDOW (chooser),
GTK_WINDOW (WID
("keyboard_dialog")));
xkb_options_load_options (chooser_dialog);
g_signal_connect (chooser, "response",
G_CALLBACK (chooser_response_cb), dialog);
gtk_dialog_run (GTK_DIALOG (chooser));
}
示例5: update_remove_button
static void
update_remove_button (CcBackgroundPanel *panel,
CcBackgroundItem *item)
{
CcBackgroundPanelPrivate *priv;
const char *uri;
char *cache_path;
GFile *bg, *cache, *parent;
gboolean sensitive = FALSE;
priv = panel->priv;
if (priv->current_source != SOURCE_PICTURES)
goto bail;
uri = cc_background_item_get_uri (item);
if (uri == NULL)
goto bail;
bg = g_file_new_for_uri (uri);
parent = g_file_get_parent (bg);
if (parent == NULL)
{
g_object_unref (bg);
goto bail;
}
cache_path = bg_pictures_source_get_cache_path ();
cache = g_file_new_for_path (cache_path);
g_free (cache_path);
if (g_file_equal (parent, cache))
sensitive = TRUE;
g_object_unref (parent);
g_object_unref (cache);
bail:
gtk_widget_set_sensitive (WID ("remove_button"), sensitive);
}
示例6: update_mixer_tracks_selection
static void
update_mixer_tracks_selection (GSList *tracks, GladeXML *dialog)
{
GtkWidget *tracks_widget;
GtkTreeModel *model;
GtkTreeSelection *selection;
GtkTreeIter iter;
tracks_widget = WID ("mixer_tracks");
model = gtk_tree_view_get_model (GTK_TREE_VIEW (tracks_widget));
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tracks_widget));
g_signal_handlers_block_by_func (G_OBJECT (selection), G_CALLBACK (mixer_tracks_selection_changed), NULL);
gtk_tree_selection_unselect_all (selection);
if (tracks != NULL) {
if (gtk_tree_model_get_iter_first (model, &iter)) {
do {
gchar *label;
GSList *t;
gtk_tree_model_get (model, &iter, MIXER_TRACKS_MODEL_LABEL_COLUMN, &label, -1);
for (t = tracks; t != NULL; t = t->next) {
if (!strcmp (label, t->data)) {
gtk_tree_selection_select_iter (selection, &iter);
break;
}
}
g_free (label);
} while (gtk_tree_model_iter_next (model, &iter));
}
}
g_signal_handlers_unblock_by_func (G_OBJECT (selection), G_CALLBACK (mixer_tracks_selection_changed), NULL);
/* FIXME: if none selected, select master track */
}
示例7: screen_position_notify_cb
static void
screen_position_notify_cb (GSettings *settings,
const gchar *key,
ZoomOptions *options)
{
ZoomOptionsPrivate *priv = options->priv;
gchar *position;
GtkTreeIter iter;
GtkTreeModel *model;
GtkComboBox *combobox;
gboolean valid;
gchar *combo_value;
position = g_settings_get_string (settings, key);
position = g_settings_get_string (priv->settings, key);
combobox = GTK_COMBO_BOX (WID ("screen_position_combo_box"));
model = gtk_combo_box_get_model (combobox);
/* Find the matching screen position value in the combobox model. If nothing
* matches, leave the combobox as is.
*/
valid = gtk_tree_model_get_iter_first (model, &iter);
while (valid)
{
gtk_tree_model_get (model, &iter,
POSITION_MODEL_VALUE_COLUMN, &combo_value,
-1);
if (!g_strcmp0 (combo_value, position))
{
g_signal_handlers_block_by_func (combobox, screen_position_combo_changed_cb, priv);
gtk_combo_box_set_active_iter (combobox, &iter);
g_signal_handlers_unblock_by_func (combobox, screen_position_combo_changed_cb, priv);
g_free (combo_value);
break;
}
g_free (combo_value);
valid = gtk_tree_model_iter_next (model, &iter);
}
}
示例8: update_button_sensitivity
static void
update_button_sensitivity (GtkBuilder *builder)
{
GtkWidget *remove_button;
GtkWidget *up_button;
GtkWidget *down_button;
GtkWidget *show_button;
GtkWidget *settings_button;
GtkTreeView *tv;
GtkTreeModel *model;
GtkTreeIter iter;
gint n_active;
gint index;
gboolean settings_sensitive;
GDesktopAppInfo *app_info;
remove_button = WID("input_source_remove");
show_button = WID("input_source_show");
up_button = WID("input_source_move_up");
down_button = WID("input_source_move_down");
settings_button = WID("input_source_settings");
tv = GTK_TREE_VIEW (WID ("active_input_sources"));
n_active = gtk_tree_model_iter_n_children (gtk_tree_view_get_model (tv), NULL);
if (get_selected_iter (builder, &model, &iter))
{
index = idx_from_model_iter (model, &iter);
gtk_tree_model_get (model, &iter, SETUP_COLUMN, &app_info, -1);
}
else
{
index = -1;
app_info = NULL;
}
settings_sensitive = (index >= 0 && app_info != NULL);
if (app_info)
g_object_unref (app_info);
gtk_widget_set_sensitive (remove_button, index >= 0 && n_active > 1);
gtk_widget_set_sensitive (show_button, index >= 0);
gtk_widget_set_sensitive (up_button, index > 0);
gtk_widget_set_sensitive (down_button, index >= 0 && index < n_active - 1);
gtk_widget_set_sensitive (settings_button, settings_sensitive);
}
示例9: passdlg_set_busy
/* Sets dialog busy state according to busy
*
* When busy:
* Sets the cursor to busy
* Disables the interface to prevent that the user interferes
* Reverts all this when non-busy
*
* Note that this function takes into account the
* authentication state of the dialog. So setting the
* dialog to busy and then back to normal should leave
* the dialog unchanged.
*/
static void
passdlg_set_busy (PasswordDialog *pdialog, gboolean busy)
{
GtkBuilder *dialog;
GtkWidget *toplevel;
GdkCursor *cursor = NULL;
GdkDisplay *display;
dialog = pdialog->ui;
/* Set cursor */
toplevel = WID ("change-password");
display = gtk_widget_get_display (toplevel);
if (busy) {
cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
}
gdk_window_set_cursor (gtk_widget_get_window (toplevel), cursor);
gdk_display_flush (display);
if (busy) {
gdk_cursor_unref (cursor);
}
/* Disable/Enable UI */
if (pdialog->authenticated) {
/* Authenticated state */
/* Enable/disable new password section */
g_object_set (pdialog->new_password, "sensitive", !busy, NULL);
g_object_set (pdialog->retyped_password, "sensitive", !busy, NULL);
g_object_set (WID ("new-password-label"), "sensitive", !busy, NULL);
g_object_set (WID ("retyped-password-label"), "sensitive", !busy, NULL);
/* Enable/disable change password button */
g_object_set (WID ("change-password-button"), "sensitive", !busy, NULL);
} else {
/* Not-authenticated state */
/* Enable/disable auth section state */
g_object_set (pdialog->current_password, "sensitive", !busy, NULL);
g_object_set (WID ("authenticate-button"), "sensitive", !busy, NULL);
g_object_set (WID ("current-password-label"), "sensitive", !busy, NULL);
}
}
示例10: assert
DIA_encoding::DIA_encoding( uint32_t fps1000 )
{
assert(dialog==NULL);
stopReq=0;
_roundup=floor( (fps1000+999)/1000);
for(uint32_t i=0;i<_roundup;i++)
_bitrate[i]=0;
_totalSize=0;
_current=0;
dialog=create_dialog1();
//gtk_transient(dialog);
gtk_signal_connect(GTK_OBJECT(WID(closebutton1)), "clicked",
GTK_SIGNAL_FUNC(DIA_stop), NULL);
gtk_signal_connect(GTK_OBJECT(dialog), "delete_event",
GTK_SIGNAL_FUNC(on_destroy_abort), NULL);
gtk_widget_show(dialog);
UI_iconify();
_lastTime=0;
_lastFrame=0;
_fps_average=0;
}
示例11: create_dialog
static GladeXML *
create_dialog (void)
{
GladeXML *dialog;
GtkWidget *widget, *box, *view, *image;
dialog = glade_xml_new (GNOMECC_GLADE_DIR "/sound-properties.glade", "sound_prefs_dialog", NULL);
if (dialog == NULL)
return NULL;
widget = glade_xml_get_widget (dialog, "sound_prefs_dialog");
props = sound_properties_new ();
sound_properties_add_defaults (props, NULL);
g_signal_connect (G_OBJECT (props), "event_changed",
(GCallback) props_changed_cb, NULL);
view = sound_view_new (props);
box = glade_xml_get_widget (dialog, "events_vbox");
gtk_box_pack_start (GTK_BOX (box), view, TRUE, TRUE, 0);
gtk_widget_show_all (view);
g_signal_connect_swapped (G_OBJECT (widget), "destroy",
(GCallback) gtk_object_destroy, props);
gtk_image_set_from_file (GTK_IMAGE (WID ("bell_image")),
GNOMECC_DATA_DIR "/pixmaps/visual-bell.png");
image = gtk_image_new_from_stock (GTK_STOCK_APPLY, GTK_ICON_SIZE_BUTTON);
gtk_button_set_image (GTK_BUTTON (WID ("sounds_playback_test")), image);
image = gtk_image_new_from_stock (GTK_STOCK_APPLY, GTK_ICON_SIZE_BUTTON);
gtk_button_set_image (GTK_BUTTON (WID ("music_playback_test")), image);
image = gtk_image_new_from_stock (GTK_STOCK_APPLY, GTK_ICON_SIZE_BUTTON);
gtk_button_set_image (GTK_BUTTON (WID ("chat_audio_playback_test")), image);
image = gtk_image_new_from_stock (GTK_STOCK_APPLY, GTK_ICON_SIZE_BUTTON);
gtk_button_set_image (GTK_BUTTON (WID ("chat_audio_capture_test")), image);
if (!CheckXKB()) {
gtk_widget_set_sensitive (WID ("bell_flash_alignment"), FALSE);
}
return dialog;
}
示例12: Hue
/**
\fn DIA_getHue
\brief Handle Hue (fly)Dialog
*/
uint8_t DIA_getHue(Hue_Param *param, AVDMGenericVideoStream *in)
{
uint32_t width,height;
uint8_t ret=0;
// Allocate space for green-ised video
width=in->getInfo()->width;
height=in->getInfo()->height;
dialog=create_dialog1();
gtk_dialog_set_alternative_button_order(GTK_DIALOG(dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
gtk_register_dialog(dialog);
gtk_window_set_title (GTK_WINDOW (dialog), QT_TR_NOOP("Hue"));
gtk_signal_connect(GTK_OBJECT(WID(drawingarea1)), "expose_event",
GTK_SIGNAL_FUNC(draw),
NULL);
//
gtk_signal_connect(GTK_OBJECT(WID(hscale1)), "value_changed",GTK_SIGNAL_FUNC(frame_changed), NULL);
gtk_signal_connect(GTK_OBJECT(WID(hscaleHue)), "value_changed",GTK_SIGNAL_FUNC(hue_changed), NULL);
gtk_signal_connect(GTK_OBJECT(WID(hscaleSaturation)), "value_changed",GTK_SIGNAL_FUNC(hue_changed), NULL);
gtk_widget_show(dialog);
myCrop=new flyHue( width, height,in,WID(drawingarea1),WID(hscale1));
memcpy(&(myCrop->param),param,sizeof(Hue_Param));
myCrop->upload();
myCrop->sliderChanged();
ret=0;
int response;
response=gtk_dialog_run(GTK_DIALOG(dialog));
if(response==GTK_RESPONSE_OK)
{
myCrop->download();
memcpy(param,&(myCrop->param),sizeof(Hue_Param));
ret=1;
}
gtk_unregister_dialog(dialog);
gtk_widget_destroy(dialog);
delete myCrop;
return ret;
}
示例13: finish_calibration
static void
finish_calibration (CalibArea *area,
gpointer user_data)
{
CcWacomPage *page = (CcWacomPage *) user_data;
CcWacomPagePrivate *priv = page->priv;
XYinfo axis;
gboolean swap_xy;
int cal[4];
if (calib_area_finish (area, &axis, &swap_xy)) {
cal[0] = axis.x_min;
cal[1] = axis.y_min;
cal[2] = axis.x_max;
cal[3] = axis.y_max;
set_calibration(cal, 4, priv->wacom_settings);
}
calib_area_free (area);
priv->area = NULL;
gtk_widget_set_sensitive (WID ("button-calibrate"), TRUE);
}
示例14: cc_ua_panel_init_seeing
static void
cc_ua_panel_init_seeing (CcUaPanel *self)
{
CcUaPanelPrivate *priv = self->priv;
text_scaling_factor_notify_cb (priv->interface_settings, "text-scaling-factor", self);
g_signal_connect (priv->interface_settings, "changed::text-scaling-factor", G_CALLBACK (text_scaling_factor_notify_cb), self);
g_signal_connect (WID (priv->builder, "seeing_contrast_combobox"), "changed",
G_CALLBACK (contrast_combobox_changed_cb), self);
g_signal_connect (WID (priv->builder, "seeing_text_size_combobox"), "changed",
G_CALLBACK (text_scaling_factor_combo_box_changed), self);
g_settings_bind (priv->kb_settings, "togglekeys-enable",
WID (priv->builder, "seeing_enable_toggle_keys_checkbutton"), "active",
G_SETTINGS_BIND_DEFAULT);
priv->shell_watch_id = g_bus_watch_name (G_BUS_TYPE_SESSION,
"org.gnome.Shell",
G_BUS_NAME_WATCHER_FLAGS_NONE,
(GBusNameAppearedCallback) shell_appeared_cb,
(GBusNameVanishedCallback) shell_vanished_cb,
self,
NULL);
g_signal_connect (WID (priv->builder, "seeing_zoom_preferences_button"),
"clicked",
G_CALLBACK (zoom_options_launch_cb), self);
g_settings_bind (priv->application_settings, "screen-magnifier-enabled",
WID (priv->builder, "seeing_zoom_switch"), "active",
G_SETTINGS_BIND_DEFAULT);
settings_on_off_editor_new (priv, priv->application_settings,
"screen-reader-enabled",
WID (priv->builder, "seeing_reader_switch"),
NULL);
cc_ua_panel_set_shortcut_label (self, "seeing_contrast_toggle_keybinding_label", "toggle-contrast");
cc_ua_panel_set_shortcut_label (self, "seeing_increase_size_keybinding_label", "increase-text-size");
cc_ua_panel_set_shortcut_label (self, "seeing_decrease_size_keybinding_label", "decrease-text-size");
cc_ua_panel_set_shortcut_label (self, "seeing_zoom_enable_keybinding_label", "magnifier");
cc_ua_panel_set_shortcut_label (self, "seeing_zoom_in_keybinding_label", "magnifier-zoom-in");
cc_ua_panel_set_shortcut_label (self, "seeing_zoom_out_keybinding_label", "magnifier-zoom-out");
cc_ua_panel_set_shortcut_label (self, "seeing_reader_enable_keybinding_label", "screenreader");
}
示例15: display_properties_dialog
static void
display_properties_dialog (GtkAction *action,
TasklistData *tasklist)
{
if (tasklist->properties_dialog == NULL) {
GtkBuilder *builder;
GError *error;
builder = gtk_builder_new ();
gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE);
error = NULL;
gtk_builder_add_from_file (builder, TASKLIST_BUILDERDIR "/window-list.ui", &error);
if (error) {
g_warning ("Error loading preferences: %s", error->message);
g_error_free (error);
return;
}
tasklist->properties_dialog = WID ("tasklist_properties_dialog");
g_object_add_weak_pointer (G_OBJECT (tasklist->properties_dialog),
(void**) &tasklist->properties_dialog);
setup_dialog (builder, tasklist);
g_object_unref (builder);
}
gtk_window_set_icon_name (GTK_WINDOW (tasklist->properties_dialog),
WINDOW_LIST_ICON);
gtk_window_set_resizable (GTK_WINDOW (tasklist->properties_dialog), FALSE);
gtk_window_set_screen (GTK_WINDOW (tasklist->properties_dialog),
gtk_widget_get_screen (tasklist->applet));
gtk_window_present (GTK_WINDOW (tasklist->properties_dialog));
}