本文整理汇总了C++中GTK_IS_BUTTON函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_IS_BUTTON函数的具体用法?C++ GTK_IS_BUTTON怎么用?C++ GTK_IS_BUTTON使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GTK_IS_BUTTON函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ipreferences_merge
static void
ipreferences_merge (IAnjutaPreferences* ipref,
AnjutaPreferences* prefs,
GError** e)
{
GError* error = NULL;
GtkBuilder* bxml = gtk_builder_new ();
GtkTreeView *global_vars_view = NULL;
GtkButton *add_variable_b = NULL, *delete_variable_b = NULL;
SnippetsManagerPlugin *snippets_manager_plugin = NULL;
GlobalVariablesUpdateData *global_vars_update_data = NULL;
/* Assertions */
snippets_manager_plugin = ANJUTA_PLUGIN_SNIPPETS_MANAGER (ipref);
g_return_if_fail (ANJUTA_IS_PLUGIN_SNIPPETS_MANAGER (snippets_manager_plugin));
if (!gtk_builder_add_from_file (bxml, PREFERENCES_UI, &error))
{
g_warning ("Couldn't load preferences ui file: %s", error->message);
g_error_free (error);
}
anjuta_preferences_add_from_builder (prefs, bxml, SNIPPETS_MANAGER_PREFERENCES_ROOT, _("Code Snippets"),
ICON_FILE);
/* Get the Gtk objects */
global_vars_view = GTK_TREE_VIEW (gtk_builder_get_object (bxml, "global_vars_view"));
add_variable_b = GTK_BUTTON (gtk_builder_get_object (bxml, "add_var_button"));
delete_variable_b = GTK_BUTTON (gtk_builder_get_object (bxml, "delete_var_button"));
g_return_if_fail (GTK_IS_TREE_VIEW (global_vars_view));
g_return_if_fail (GTK_IS_BUTTON (add_variable_b));
g_return_if_fail (GTK_IS_BUTTON (delete_variable_b));
/* Set up the Global Variables GtkTreeView */
set_up_global_variables_view (snippets_manager_plugin, global_vars_view);
/* Connect the addition/deletion buttons */
global_vars_update_data = g_malloc (sizeof (GlobalVariablesUpdateData));
global_vars_update_data->snippets_db = snippets_manager_plugin->snippets_db;
global_vars_update_data->global_vars_view = global_vars_view;
g_signal_connect (GTK_OBJECT (add_variable_b),
"clicked",
GTK_SIGNAL_FUNC (on_add_variable_b_clicked),
global_vars_update_data);
g_signal_connect (GTK_OBJECT (delete_variable_b),
"clicked",
GTK_SIGNAL_FUNC (on_delete_variable_b_clicked),
global_vars_update_data);
g_object_unref (bxml);
}
示例2: NLDT_gtk_signal_connect
extern int NLDT_gtk_signal_connect(struct lua_State *L)
{
/*
LUA Use:
gtk_signal_connect(widget, "signal", "lua_function")
*/
if(lua_gettop(L)!=3)
{
lua_pushstring(L,"ERROR gtk_signal_connect usage widget, \"signal\", \"lua_func\"\n");
lua_error(L);
}
GtkWidget *widget = (GtkWidget*)luaL_checkint(L,1);
char *callback = (char*)lua_tostring(L,2);
char *lua_func = (char*)lua_tostring(L,3);
callback_data *cback = g_new(callback_data,1);
cback->gizmo = nldt_gizmo_lookup(L);
cback->func_name = g_strdup(lua_func);
if(GTK_IS_BUTTON(widget))
{
g_signal_connect(G_OBJECT(widget),callback,G_CALLBACK(NLDT_button_click_callback),cback);
}
if(GTK_IS_LABEL(widget))
{
printf("hehe, silly rabbit, callbacks are for buttons!\n");
}
return 0;
}
示例3: gb_rename_file_popover__button_clicked
static void
gb_rename_file_popover__button_clicked (GbRenameFilePopover *self,
GtkButton *button)
{
g_autoptr(GFile) file = NULL;
g_autoptr(GFile) parent = NULL;
const gchar *path;
g_assert (GB_IS_RENAME_FILE_POPOVER (self));
g_assert (GTK_IS_BUTTON (button));
g_assert (self->file != NULL);
g_assert (G_IS_FILE (self->file));
path = gtk_entry_get_text (self->entry);
if (ide_str_empty0 (path))
return;
parent = g_file_get_parent (self->file);
file = g_file_get_child (parent, path);
/* only activate once */
gtk_widget_set_sensitive (GTK_WIDGET (self->button), FALSE);
g_signal_emit (self, signals [RENAME_FILE], 0, self->file, file);
}
示例4: kolab_folder_metadata_ui_foldertype_cb
static void
kolab_folder_metadata_ui_foldertype_cb (GtkRadioButton *btn,
gpointer userdata)
{
KolabFolderMetaUIData *uidata = NULL;
KolabFolderTypeID foldertype = KOLAB_FOLDER_TYPE_INVAL;
GtkWidget *ok_btn = NULL;
gpointer type = NULL;
g_return_if_fail (GTK_IS_RADIO_BUTTON (btn));
g_return_if_fail (userdata != NULL);
uidata = (KolabFolderMetaUIData *) userdata;
g_return_if_fail (uidata->widgets != NULL);
type = g_hash_table_lookup (uidata->widgets->folder_type_map,
(gpointer) btn);
if (type != NULL)
foldertype = GPOINTER_TO_UINT (type);
if ((foldertype > KOLAB_FOLDER_TYPE_INVAL) &&
(foldertype < KOLAB_FOLDER_LAST_TYPE)) {
uidata->metadata->foldertype = foldertype;
uidata->changed_metadata = TRUE;
}
ok_btn = e_kolab_plugin_util_ui_dialog_ref_button (uidata->dialog,
GTK_STOCK_OK,
TRUE);
g_return_if_fail (GTK_IS_BUTTON (ok_btn));
gtk_widget_set_sensitive (ok_btn, TRUE);
g_object_unref (ok_btn);
}
示例5: kolab_folder_metadata_ui_syncstrategy_cb
static void
kolab_folder_metadata_ui_syncstrategy_cb (GtkComboBoxText *box,
gpointer userdata)
{
GtkWidget *ok_btn = NULL;
KolabFolderMetaUIData *uidata = NULL;
gint active = 0;
g_return_if_fail (GTK_IS_COMBO_BOX_TEXT (box));
g_return_if_fail (userdata != NULL);
uidata = (KolabFolderMetaUIData *) userdata;
g_return_if_fail (uidata->metadata != NULL);
active = gtk_combo_box_get_active (GTK_COMBO_BOX (box));
uidata->metadata->strategy = (KolabFolderTypeID) active;
uidata->changed_syncstrategy = TRUE;
ok_btn = e_kolab_plugin_util_ui_dialog_ref_button (uidata->dialog,
GTK_STOCK_OK,
TRUE);
g_return_if_fail (GTK_IS_BUTTON (ok_btn));
gtk_widget_set_sensitive (ok_btn, TRUE);
g_object_unref (ok_btn);
}
示例6: glade_gtk_button_post_create
void
glade_gtk_button_post_create (GladeWidgetAdaptor * adaptor,
GObject * button, GladeCreateReason reason)
{
GladeWidget *gbutton = glade_widget_get_from_gobject (button);
g_return_if_fail (GTK_IS_BUTTON (button));
g_return_if_fail (GLADE_IS_WIDGET (gbutton));
if (GTK_IS_FONT_BUTTON (button))
g_signal_connect
(button, "font-set",
G_CALLBACK (glade_gtk_font_button_refresh_font_name), gbutton);
else if (GTK_IS_COLOR_BUTTON (button))
g_signal_connect
(button, "color-set",
G_CALLBACK (glade_gtk_color_button_refresh_color), gbutton);
/* Disabled response-id until its in an action area */
glade_widget_property_set_sensitive (gbutton, "response-id", FALSE,
RESPID_INSENSITIVE_MSG);
if (reason == GLADE_CREATE_USER)
glade_gtk_button_update_stock (gbutton);
}
示例7: gimp_dialog_response
static void
gimp_dialog_response (GtkDialog *dialog,
gint response_id)
{
GList *children;
GList *list;
children = gtk_container_get_children (GTK_CONTAINER (dialog->action_area));
for (list = children; list; list = g_list_next (list))
{
GtkWidget *widget = list->data;
if (gtk_dialog_get_response_for_widget (dialog, widget) == response_id)
{
if (! GTK_IS_BUTTON (widget) ||
gtk_button_get_focus_on_click (GTK_BUTTON (widget)))
{
gtk_widget_grab_focus (widget);
}
break;
}
}
g_list_free (children);
}
示例8: widget_set_sensitive
void widget_set_sensitive(GtkWidget * widget, gboolean sensitive)
{
GtkWidget *button;
gtk_widget_set_sensitive(widget, sensitive);
/** @bug Gtk bug 56070. If the mouse is over a toolbar button that
* becomes sensitive, one can't click it without moving the mouse out
* and in again. This bug is registered in Bugzilla as a Gtk bug. The
* workaround tests if the mouse is inside the currently sensitivized
* button, and if yes call button_enter()
*/
if (!GTK_IS_BIN(widget))
return;
button = gtk_bin_get_child(GTK_BIN(widget));
if (sensitive && GTK_IS_BUTTON(button)) {
gint x, y, state;
gtk_widget_get_pointer(button, &x, &y);
state = GTK_WIDGET_STATE(button);
if ((state == GTK_STATE_NORMAL
|| state == GTK_STATE_PRELIGHT) && x >= 0 && y >= 0
&& x < button->allocation.width
&& y < button->allocation.height) {
gtk_button_enter(GTK_BUTTON(button));
GTK_BUTTON(button)->in_button = TRUE;
gtk_widget_set_state(widget, GTK_STATE_PRELIGHT);
}
}
}
示例9: setup_device_chooser
static void
setup_device_chooser (const gchar *profile, int type, GtkWidget *combobox, GtkWidget *test_button, const gchar *test_pipeline)
{
DeviceChooser *device_chooser;
GtkCellRenderer *cell;
gchar *gconf_key;
g_return_if_fail (GTK_IS_COMBO_BOX (combobox));
g_return_if_fail (GTK_IS_BUTTON (test_button));
device_chooser = g_malloc0 (sizeof (DeviceChooser));
device_chooser->profile = profile;
device_chooser->type = type;
device_chooser->combobox = combobox;
device_chooser->model = gtk_list_store_new (4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING);
device_chooser->test_pipeline = test_pipeline;
gtk_combo_box_set_model (GTK_COMBO_BOX (combobox), GTK_TREE_MODEL (device_chooser->model));
cell = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combobox), cell, TRUE);
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (combobox), cell, "text", 1);
device_choosers = g_list_prepend (device_choosers, device_chooser);
gconf_key = get_gconf_key_for_profile (profile, type);
gconf_client_notify_add (gconf_client, gconf_key, gconf_key_changed,
device_chooser, NULL, NULL);
g_free (gconf_key);
g_signal_connect (combobox, "changed", G_CALLBACK (device_changed), device_chooser);
g_signal_connect (test_button, "clicked", G_CALLBACK (device_test_button_clicked), device_chooser);
}
示例10: gwy_sensitivity_group_debug
static void
gwy_sensitivity_group_debug(GwySensitivityGroup *sensgroup)
{
SensList *senslist;
GtkWidget *widget, *w;
GList *l, *ll;
const gchar *s;
gint nw = 0;
g_printerr("SENS GROUP %p\n", sensgroup);
for (ll = sensgroup->lists; ll; ll = g_list_next(ll)) {
g_printerr(" LIST: ");
senslist = (SensList*)ll->data;
g_printerr("mask=%04x, dirty=%d, parent=%p\n",
senslist->mask, senslist->dirty, senslist->parent);
for (l = senslist->widgets; l; l = g_list_next(l)) {
nw++;
g_printerr(" WIDGET: ");
widget = GTK_WIDGET(l->data);
g_printerr("%s ", g_type_name(G_TYPE_FROM_INSTANCE(widget)));
if (GTK_IS_BUTTON(widget)) {
s = gtk_button_get_label(GTK_BUTTON(widget));
if (s)
g_printerr("<%s> ", s);
else {
w = gtk_bin_get_child(GTK_BIN(widget));
if (w) {
g_printerr("%s ", g_type_name(G_TYPE_FROM_INSTANCE(w)));
if (GTK_IS_LABEL(w)) {
s = gtk_label_get_text(GTK_LABEL(w));
if (s)
g_printerr("<%s> ", s);
}
else if (GTK_IS_IMAGE(w)) {
s = NULL;
gtk_image_get_stock(GTK_IMAGE(w), (gchar**)&s,
NULL);
if (s)
g_printerr("<%s> ", s);
}
}
}
}
else if (GTK_IS_MENU_ITEM(widget)) {
w = gtk_bin_get_child(GTK_BIN(widget));
if (w) {
g_printerr("%s ", g_type_name(G_TYPE_FROM_INSTANCE(w)));
if (GTK_IS_LABEL(w)) {
s = gtk_label_get_text(GTK_LABEL(w));
if (s)
g_printerr("<%s> ", s);
}
}
}
g_printerr("\n");
}
}
g_printerr(" nwidgets=%d, ref_count=%d\n",
nw, G_OBJECT(sensgroup)->ref_count);
}
示例11: xfce_panel_image_padding_correction
/* When can_focus is true, GtkButton allocates larger size than requested *
* and causes the panel image to grow indefinitely. *
* This workaround compensates for this difference. *
* Details in https://bugzilla.gnome.org/show_bug.cgi?id=698030 *
*/
static gint
xfce_panel_image_padding_correction (GtkWidget *widget)
{
GtkWidget *parent;
GtkStyleContext *context;
gint focus_width;
gint focus_pad;
gint correction;
parent = gtk_widget_get_parent (widget);
if (parent != NULL &&
GTK_IS_BUTTON (parent) &&
!gtk_widget_get_can_focus (parent))
{
context = gtk_widget_get_style_context (parent);
gtk_style_context_get_style (context,
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
NULL);
correction = (focus_width + focus_pad) * 2;
}
else
{
correction = 0;
}
return correction;
}
示例12: gtk_button_leave
void
gtk_button_leave (GtkButton *button)
{
g_return_if_fail (GTK_IS_BUTTON (button));
g_signal_emit (button, button_signals[LEAVE], 0);
}
示例13: gtk_button_clicked
void
gtk_button_clicked (GtkButton *button)
{
g_return_if_fail (GTK_IS_BUTTON (button));
g_signal_emit (button, button_signals[CLICKED], 0);
}
示例14: gtk_button_enter
void
gtk_button_enter (GtkButton *button)
{
g_return_if_fail (GTK_IS_BUTTON (button));
g_signal_emit (button, button_signals[ENTER], 0);
}
示例15: gtk_button_pressed
void
gtk_button_pressed (GtkButton *button)
{
g_return_if_fail (GTK_IS_BUTTON (button));
g_signal_emit (button, button_signals[PRESSED], 0);
}