• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GTK_IS_BUTTON函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GTK_IS_BUTTON函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_IS_BUTTON函数的具体用法?C++ GTK_IS_BUTTON怎么用?C++ GTK_IS_BUTTON使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GTK_IS_BUTTON函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:dragos-dena,项目名称:Anjuta-Snippets-Plugin,代码行数:52,代码来源:plugin.c


示例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;
}
开发者ID:ElFeesho,项目名称:OldCProjects,代码行数:27,代码来源:gtk_binds.c


示例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);
}
开发者ID:riadnassiffe,项目名称:gnome-builder,代码行数:25,代码来源:gb-rename-file-popover.c


示例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);
}
开发者ID:GNOME,项目名称:evolution-kolab,代码行数:33,代码来源:e-kolab-folder-metadata.c


示例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);
}
开发者ID:GNOME,项目名称:evolution-kolab,代码行数:25,代码来源:e-kolab-folder-metadata.c


示例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);
}
开发者ID:kugel-,项目名称:glade,代码行数:25,代码来源:glade-gtk-button.c


示例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);
}
开发者ID:Amerekanets,项目名称:gimp,代码行数:27,代码来源:gimpdialog.c


示例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);
		}
	}
}
开发者ID:Alex-Sjoberg,项目名称:Pioneers,代码行数:30,代码来源:gtkbugs.c


示例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);
}
开发者ID:federicomenaquintero,项目名称:gnome-control-center,代码行数:33,代码来源:sound-properties-capplet.c


示例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);
}
开发者ID:DavidMercier,项目名称:gwyddion,代码行数:60,代码来源:gwysensitivitygroup.c


示例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;
}
开发者ID:BrotherAl,项目名称:xfce4-panel,代码行数:33,代码来源:xfce-panel-image.c


示例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);
}
开发者ID:zjx632,项目名称:tinygtk,代码行数:7,代码来源:gtkbutton.c


示例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);
}
开发者ID:zjx632,项目名称:tinygtk,代码行数:7,代码来源:gtkbutton.c


示例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);
}
开发者ID:zjx632,项目名称:tinygtk,代码行数:7,代码来源:gtkbutton.c


示例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);
}
开发者ID:zjx632,项目名称:tinygtk,代码行数:7,代码来源:gtkbutton.c


示例16: gtk_button_released

void
gtk_button_released (GtkButton *button)
{
  g_return_if_fail (GTK_IS_BUTTON (button));

  g_signal_emit (button, button_signals[RELEASED], 0);
}
开发者ID:zjx632,项目名称:tinygtk,代码行数:7,代码来源:gtkbutton.c


示例17: gtk_button_get_label

/**
 * gtk_button_get_label:
 * @button: a #GtkButton
 *
 * Fetches the text from the label of the button, as set by
 * gtk_button_set_label(). If the label text has not 
 * been set the return value will be %NULL. This will be the 
 * case if you create an empty button with gtk_button_new() to 
 * use as a container.
 *
 * Return value: The text of the label widget. This string is owned
 * by the widget and must not be modified or freed.
 **/
G_CONST_RETURN gchar *
gtk_button_get_label (GtkButton *button)
{
  g_return_val_if_fail (GTK_IS_BUTTON (button), NULL);
  
  return button->label_text;
}
开发者ID:zjx632,项目名称:tinygtk,代码行数:20,代码来源:gtkbutton.c


示例18: gtk_button_get_use_stock

/**
 * gtk_button_get_use_stock:
 * @button: a #GtkButton
 *
 * Returns whether the button label is a stock item.
 *
 * Return value: %TRUE if the button label is used to
 *               select a stock item instead of being
 *               used directly as the label text.
 */
gboolean
gtk_button_get_use_stock (GtkButton *button)
{
  g_return_val_if_fail (GTK_IS_BUTTON (button), FALSE);
  
  return button->use_stock;
}
开发者ID:zjx632,项目名称:tinygtk,代码行数:17,代码来源:gtkbutton.c


示例19: get_event_widget

static GtkWidget *
get_event_widget (GtkWidget *proxy)
{
	GtkWidget *widget;

	/**
	 * Finding the interesting widget requires internal knowledge of
	 * the widgets in question. This can't be helped, but by keeping
	 * the sneaky code in one place, it can easily be updated.
	 */
	if (GTK_IS_MENU_ITEM (proxy)) {
		/* Menu items already forward middle clicks */
		widget = NULL;
	} else if (GTK_IS_MENU_TOOL_BUTTON (proxy)) {
		widget = eel_gtk_menu_tool_button_get_button (GTK_MENU_TOOL_BUTTON (proxy));
	} else if (GTK_IS_TOOL_BUTTON (proxy)) {
		/* The tool button's button is the direct child */
		widget = gtk_bin_get_child (GTK_BIN (proxy));
	} else if (GTK_IS_BUTTON (proxy)) {
		widget = proxy;
	} else {
		/* Don't touch anything we don't know about */
		widget = NULL;
	}

	return widget;
}
开发者ID:MDC,项目名称:Nautilus-Toolbar-Editor,代码行数:27,代码来源:nautilus-window-menus.c


示例20: _put_button_as_inactive

void _put_button_as_inactive(grid_button_t *grid_button)
{
	if (GTK_IS_BUTTON(grid_button->button)) {
		//gtk_widget_set_sensitive (grid_button->button, false);
		return;
	}
	gtk_widget_destroy(grid_button->button);
	grid_button->button = gtk_button_new();
	gtk_widget_set_size_request(grid_button->button,
				    working_sview_config.button_size,
				    working_sview_config.button_size);
	//gtk_widget_set_sensitive (grid_button->button, false);

	_add_button_signals(grid_button);

/* 	if (grid_button->frame) */
/* 		gtk_container_add(GTK_CONTAINER(grid_button->frame), */
/* 				  grid_button->button); */
	if (grid_button->table)
		gtk_table_attach(grid_button->table, grid_button->button,
				 grid_button->table_x,
				 (grid_button->table_x+1),
				 grid_button->table_y,
				 (grid_button->table_y+1),
				 GTK_SHRINK, GTK_SHRINK,
				 1, 1);
	gtk_widget_show_all(grid_button->button);
	return;
}
开发者ID:jtfrey,项目名称:slurm,代码行数:29,代码来源:grid.c



注:本文中的GTK_IS_BUTTON函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GTK_IS_CONTAINER函数代码示例发布时间:2022-05-30
下一篇:
C++ GTK_IS_ACTION函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap