您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GTK_ACTION_GROUP函数代码示例

51自学网 2021-06-01 20:57:33
  C++
这篇教程C++ GTK_ACTION_GROUP函数代码示例写得很实用,希望能帮到您。

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

在下文中一共展示了GTK_ACTION_GROUP函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: plug_in_actions_unregister_procedure

static voidplug_in_actions_unregister_procedure (GimpPDB         *pdb,                                      GimpProcedure   *procedure,                                      GimpActionGroup *group){    if (GIMP_IS_PLUG_IN_PROCEDURE (procedure))    {        GimpPlugInProcedure *plug_in_proc = GIMP_PLUG_IN_PROCEDURE (procedure);        g_signal_handlers_disconnect_by_func (plug_in_proc,                                              plug_in_actions_menu_path_added,                                              group);        if ((plug_in_proc->menu_label || plug_in_proc->menu_paths) &&                ! plug_in_proc->file_proc)        {            GtkAction *action;#if 0            g_print ("%s: %s/n", G_STRFUNC,                     gimp_object_get_name (GIMP_OBJECT (procedure)));#endif            action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),                                                  GIMP_OBJECT (procedure)->name);            if (action)                gtk_action_group_remove_action (GTK_ACTION_GROUP (group), action);        }    }}
开发者ID:Zandoch,项目名称:gimp,代码行数:31,


示例2: tool_options_actions_update_presets

static voidtool_options_actions_update_presets (GimpActionGroup *group,                                     const gchar     *action_prefix,                                     GCallback        callback,                                     const gchar     *help_id,                                     GimpContainer   *presets){  GList *list;  gint   n_children = 0;  gint   i;  for (i = 0; ; i++)    {      gchar     *action_name;      GtkAction *action;      action_name = g_strdup_printf ("%s-%03d", action_prefix, i);      action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),                                            action_name);      g_free (action_name);      if (! action)        break;      gtk_action_group_remove_action (GTK_ACTION_GROUP (group), action);    }  if (presets)    n_children = gimp_container_get_n_children (presets);  if (n_children > 0)    {      GimpEnumActionEntry entry;      entry.name           = NULL;      entry.label          = NULL;      entry.accelerator    = "";      entry.tooltip        = NULL;      entry.value          = 0;      entry.value_variable = FALSE;      entry.help_id        = help_id;      for (list = GIMP_LIST (presets)->list, i = 0;           list;           list = g_list_next (list), i++)        {          GimpObject *options = list->data;          entry.name     = g_strdup_printf ("%s-%03d", action_prefix, i);          entry.label    = gimp_object_get_name (options);          entry.stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (options));          entry.value    = i;          gimp_action_group_add_enum_actions (group, NULL, &entry, 1, callback);          g_free ((gchar *) entry.name);        }    }}
开发者ID:MichaelMure,项目名称:Gimp-Cage-Tool,代码行数:59,


示例3: edit_actions_setup

voidedit_actions_setup (GimpActionGroup *group){  GimpContext *context = gimp_get_user_context (group->gimp);  GimpRGB      color;  GimpPattern *pattern;  GtkAction   *action;  gimp_action_group_add_actions (group, "edit-action",                                 edit_actions,                                 G_N_ELEMENTS (edit_actions));  gimp_action_group_add_enum_actions (group, "edit-action",                                      edit_fill_actions,                                      G_N_ELEMENTS (edit_fill_actions),                                      G_CALLBACK (edit_fill_cmd_callback));  action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),                                        "edit-paste-as-new-short");  gtk_action_set_accel_path (action, "<Actions>/edit/edit-paste-as-new");  action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),                                        "edit-fill-pattern");  g_object_set (action, "context", context, NULL);  g_signal_connect_object (context, "foreground-changed",                           G_CALLBACK (edit_actions_foreground_changed),                           group, 0);  g_signal_connect_object (context, "background-changed",                           G_CALLBACK (edit_actions_background_changed),                           group, 0);  g_signal_connect_object (context, "pattern-changed",                           G_CALLBACK (edit_actions_pattern_changed),                           group, 0);  gimp_context_get_foreground (context, &color);  edit_actions_foreground_changed (context, &color, group);  gimp_context_get_background (context, &color);  edit_actions_background_changed (context, &color, group);  pattern = gimp_context_get_pattern (context);  edit_actions_pattern_changed (context, pattern, group);#define SET_ALWAYS_SHOW_IMAGE(action,show) /        gimp_action_group_set_action_always_show_image (group, action, show)  SET_ALWAYS_SHOW_IMAGE ("edit-fill-fg",      TRUE);  SET_ALWAYS_SHOW_IMAGE ("edit-fill-bg",      TRUE);  SET_ALWAYS_SHOW_IMAGE ("edit-fill-pattern", TRUE);#undef SET_ALWAYS_SHOW_IMAGE}
开发者ID:AdamGrzonkowski,项目名称:gimp-1,代码行数:53,


示例4: windows_actions_dock_window_removed

static voidwindows_actions_dock_window_removed (GimpDialogFactory *factory,                                     GimpDockWindow    *dock_window,                                     GimpActionGroup   *group){  GtkAction *action;  gchar     *action_name = windows_actions_dock_window_to_action_name (dock_window);  action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), action_name);  if (action)    gtk_action_group_remove_action (GTK_ACTION_GROUP (group), action);  g_free (action_name);}
开发者ID:1ynx,项目名称:gimp,代码行数:15,


示例5: gimp_action_group_set_action_active

voidgimp_action_group_set_action_active (GimpActionGroup *group,                                     const gchar     *action_name,                                     gboolean         active){  GtkAction *action;  g_return_if_fail (GIMP_IS_ACTION_GROUP (group));  g_return_if_fail (action_name != NULL);  action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), action_name);  if (! action)    {      g_warning ("%s: Unable to set /"active/" of action "                 "which doesn't exist: %s",                 G_STRFUNC, action_name);      return;    }  if (! GTK_IS_TOGGLE_ACTION (action))    {      g_warning ("%s: Unable to set /"active/" of action "                 "which is not a GtkToggleAction: %s",                 G_STRFUNC, action_name);      return;    }  gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),                                active ? TRUE : FALSE);}
开发者ID:davidyang5405,项目名称:gimp,代码行数:31,


示例6: gimp_action_group_dispose

static voidgimp_action_group_dispose (GObject *object){  const gchar *name = gtk_action_group_get_name (GTK_ACTION_GROUP (object));  if (name)    {      GimpActionGroupClass *group_class;      GList                *list;      group_class = GIMP_ACTION_GROUP_GET_CLASS (object);      list = g_hash_table_lookup (group_class->groups, name);      if (list)        {          list = g_list_remove (list, object);          if (list)            g_hash_table_replace (group_class->groups,                                  g_strdup (name), list);          else            g_hash_table_remove (group_class->groups, name);        }    }  G_OBJECT_CLASS (parent_class)->dispose (object);}
开发者ID:davidyang5405,项目名称:gimp,代码行数:28,


示例7: gimp_action_group_constructed

static voidgimp_action_group_constructed (GObject *object){  GimpActionGroup *group = GIMP_ACTION_GROUP (object);  const gchar     *name;  G_OBJECT_CLASS (parent_class)->constructed (object);  g_assert (GIMP_IS_GIMP (group->gimp));  name = gtk_action_group_get_name (GTK_ACTION_GROUP (object));  if (name)    {      GimpActionGroupClass *group_class;      GList                *list;      group_class = GIMP_ACTION_GROUP_GET_CLASS (object);      list = g_hash_table_lookup (group_class->groups, name);      list = g_list_append (list, object);      g_hash_table_replace (group_class->groups,                            g_strdup (name), list);    }}
开发者ID:davidyang5405,项目名称:gimp,代码行数:27,


示例8: menus_get_action

GtkAction *menus_get_action (const gchar *name){  GtkAction *action;  action = gtk_action_group_get_action (toolbox_actions, name);  if (!action)    action = gtk_action_group_get_action (display_actions, name);  if (!action)    action = gtk_action_group_get_action (tool_actions, name);  if (!action) {    GList *groups, *list;    /* search everything there is, could probably replace the above */    if (display_ui_manager) /* classic mode */      groups = gtk_ui_manager_get_action_groups (display_ui_manager);    else      groups = gtk_ui_manager_get_action_groups (_ui_manager);    for (list = groups; list != NULL; list = list->next) {      action = gtk_action_group_get_action (GTK_ACTION_GROUP (list->data), name);      if (action)	break;    }  }  return action;}
开发者ID:GNOME,项目名称:dia,代码行数:27,


示例9: clip_GTK_ACTIONGROUPTRANSLATESTRING

intclip_GTK_ACTIONGROUPTRANSLATESTRING(ClipMachine * ClipMachineMemory){   C_object *cagroup = _fetch_co_arg(ClipMachineMemory);   gchar    *string = _clip_parc(ClipMachineMemory, 2);   gchar    *resstr;   CHECKARG2(1, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);   CHECKCOBJ(cagroup, GTK_IS_ACTION_GROUP(cagroup->object));   CHECKARG(2, CHARACTER_type_of_ClipVarType);   LOCALE_TO_UTF(string);   resstr = (gchar *) gtk_action_group_translate_string(GTK_ACTION_GROUP(cagroup->object), string);   LOCALE_FROM_UTF(resstr);   _clip_retc(ClipMachineMemory, resstr);   FREE_TEXT(string);   FREE_TEXT(resstr);   return 0; err:   return 1;}
开发者ID:amery,项目名称:clip-angelo,代码行数:25,


示例10: clip_GTK_ACTIONGROUPSETTRANSLATEFUNC

intclip_GTK_ACTIONGROUPSETTRANSLATEFUNC(ClipMachine * ClipMachineMemory){   C_object *cagroup = _fetch_co_arg(ClipMachineMemory);   ClipVar  *cfunc = _clip_spar(ClipMachineMemory, 2);   ClipVar  *cfunc2 = _clip_spar(ClipMachineMemory, 3);   C_var    *c = NEW(C_var);   CHECKARG2(1, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);   CHECKCOBJ(cagroup, GTK_IS_ACTION_GROUP(cagroup->object));   CHECKARG2(2, PCODE_type_of_ClipVarType, CCODE_type_of_ClipVarType);   CHECKARG2(3, PCODE_type_of_ClipVarType, CCODE_type_of_ClipVarType);   c->ClipMachineMemory = ClipMachineMemory;   c->co = cagroup;   _clip_mclone(ClipMachineMemory, &c->cfunc, cfunc);   _clip_mclone(ClipMachineMemory, &c->cfunc2, cfunc2);   gtk_action_group_set_translate_func(GTK_ACTION_GROUP(cagroup->object),				       (GtkTranslateFunc) translate_func, c, (GtkDestroyNotify) destroy_notify);   return 0; err:   return 1;}
开发者ID:amery,项目名称:clip-angelo,代码行数:27,


示例11: clip_GTK_ACTIONGROUPGETACTION

intclip_GTK_ACTIONGROUPGETACTION(ClipMachine * ClipMachineMemory){   C_object *cagroup = _fetch_co_arg(ClipMachineMemory);   gchar    *name = _clip_parc(ClipMachineMemory, 2);   GtkAction *action;   C_object *caction;   CHECKARG2(1, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);   CHECKCOBJ(cagroup, GTK_IS_ACTION_GROUP(cagroup->object));   CHECKARG(2, CHARACTER_type_of_ClipVarType);   LOCALE_TO_UTF(name);   action = gtk_action_group_get_action(GTK_ACTION_GROUP(cagroup->object), name);   if (action)    {       caction = _list_get_cobject(ClipMachineMemory, action);       if (!caction)	  caction = _register_object(ClipMachineMemory, action, GTK_TYPE_ACTION, NULL, NULL);       if (caction)	  _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &caction->obj);    }   FREE_TEXT(name);   return 0; err:   return 1;}
开发者ID:amery,项目名称:clip-angelo,代码行数:33,


示例12: gimp_action_group_set_action_viewable

voidgimp_action_group_set_action_viewable (GimpActionGroup *group,                                       const gchar     *action_name,                                       GimpViewable    *viewable){  GtkAction *action;  g_return_if_fail (GIMP_IS_ACTION_GROUP (group));  g_return_if_fail (action_name != NULL);  g_return_if_fail (viewable == NULL || GIMP_IS_VIEWABLE (viewable));  action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), action_name);  if (! action)    {      g_warning ("%s: Unable to set viewable of action "                 "which doesn't exist: %s",                 G_STRFUNC, action_name);      return;    }  if (! GIMP_IS_ACTION (action))    {      g_warning ("%s: Unable to set /"viewable/" of action "                 "which is not a GimpAction: %s",                 G_STRFUNC, action_name);      return;    }  g_object_set (action, "viewable", viewable, NULL);}
开发者ID:davidyang5405,项目名称:gimp,代码行数:31,


示例13: gimp_action_group_check_unique_action

static gbooleangimp_action_group_check_unique_action (GimpActionGroup *group,				       const gchar     *action_name){  if (G_UNLIKELY (gtk_action_group_get_action (GTK_ACTION_GROUP (group),                                               action_name)))    {      g_warning ("Refusing to add non-unique action '%s' to action group '%s'",	 	 action_name,                 gtk_action_group_get_name (GTK_ACTION_GROUP (group)));      return FALSE;    }  return TRUE;}
开发者ID:davidyang5405,项目名称:gimp,代码行数:16,


示例14: windows_actions_display_remove

static voidwindows_actions_display_remove (GimpContainer   *container,                                GimpDisplay     *display,                                GimpActionGroup *group){  GtkAction *action;  gchar     *action_name = gimp_display_get_action_name (display);  action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), action_name);  if (action)    gtk_action_group_remove_action (GTK_ACTION_GROUP (group), action);  g_free (action_name);  windows_actions_update_display_accels (group);}
开发者ID:1ynx,项目名称:gimp,代码行数:17,


示例15: window_actions_display_closed

static voidwindow_actions_display_closed (GdkDisplay      *display,                               gboolean         is_error,                               GimpActionGroup *group){    const gchar *group_name;    gint         n_screens;    gint         i;    group_name = gtk_action_group_get_name (GTK_ACTION_GROUP (group));    n_screens = gdk_display_get_n_screens (display);    for (i = 0; i < n_screens; i++)    {        GdkScreen *screen = gdk_display_get_screen (display, i);        GtkAction *action;        gchar     *screen_name;        gchar     *action_name;        screen_name = gdk_screen_make_display_name (screen);        action_name = g_strdup_printf ("%s-move-to-screen-%s",                                       group_name, screen_name);        g_free (screen_name);        action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),                                              action_name);        if (action)        {            GSList *radio_group;            radio_group = gtk_radio_action_get_group (GTK_RADIO_ACTION (action));            if (radio_group->data == (gpointer) action)                radio_group = radio_group->next;            gtk_action_group_remove_action (GTK_ACTION_GROUP (group), action);            g_object_set_data (G_OBJECT (group), "change-to-screen-radio-group",                               radio_group);        }        g_free (action_name);    }}
开发者ID:Zandoch,项目名称:gimp,代码行数:45,


示例16: plug_in_actions_build_path

static voidplug_in_actions_build_path (GimpActionGroup *group,                            const gchar     *path_original,                            const gchar     *path_translated){  GHashTable *path_table;  gchar      *copy_original;  gchar      *copy_translated;  gchar      *p1, *p2;  path_table = g_object_get_data (G_OBJECT (group), "plug-in-path-table");  if (! path_table)    {      path_table = g_hash_table_new_full (g_str_hash, g_str_equal,                                          g_free, NULL);      g_object_set_data_full (G_OBJECT (group), "plug-in-path-table",                              path_table,                              (GDestroyNotify) g_hash_table_destroy);    }  copy_original   = gimp_strip_uline (path_original);  copy_translated = g_strdup (path_translated);  p1 = strrchr (copy_original, '/');  p2 = strrchr (copy_translated, '/');  if (p1 && p2 && ! g_hash_table_lookup (path_table, copy_original))    {      GtkAction *action;      gchar     *label;      label = p2 + 1;#if 0      g_print ("adding plug-in submenu '%s' (%s)/n",               copy_original, label);#endif      action = gtk_action_new (copy_original, label, NULL, NULL);      gtk_action_group_add_action (GTK_ACTION_GROUP (group), action);      g_object_unref (action);      g_hash_table_insert (path_table, g_strdup (copy_original), action);      *p1 = '/0';      *p2 = '/0';      /* recursively call ourselves with the last part of the path removed */      plug_in_actions_build_path (group, copy_original, copy_translated);    }  g_free (copy_original);  g_free (copy_translated);}
开发者ID:jiapei100,项目名称:gimp,代码行数:56,


示例17: window_actions_update

voidwindow_actions_update (GimpActionGroup *group,                       GtkWidget       *window){    const gchar *group_name;    gint         show_menu = FALSE;    gchar       *name;    group_name = gtk_action_group_get_name (GTK_ACTION_GROUP (group));#define SET_ACTIVE(action,active) /        gimp_action_group_set_action_active (group, action, (active) != 0)#define SET_VISIBLE(action,active) /        gimp_action_group_set_action_visible (group, action, (active) != 0)    if (GTK_IS_WINDOW (window))    {        GdkDisplay *display;        GdkScreen  *screen;        gchar      *screen_name;        display = gtk_widget_get_display (window);        show_menu = (gdk_display_get_n_screens (display) > 1);#ifdef GIMP_UNSTABLE        show_menu = TRUE;#endif        if (! show_menu)        {            GdkDisplayManager *manager = gdk_display_manager_get ();            GSList            *displays;            displays = gdk_display_manager_list_displays (manager);            show_menu = (displays->next != NULL);            g_slist_free (displays);        }        screen = gtk_widget_get_screen (window);        screen_name = gdk_screen_make_display_name (screen);        name = g_strdup_printf ("%s-move-to-screen-%s", group_name, screen_name);        g_free (screen_name);        SET_ACTIVE (name, TRUE);        g_free (name);    }    name = g_strdup_printf ("%s-move-to-screen-menu", group_name);    SET_VISIBLE (name, show_menu);    g_free (name);#undef SET_ACTIVE#undef SET_VISIBLE}
开发者ID:Zandoch,项目名称:gimp,代码行数:56,


示例18: gimp_action_group_add_enum_actions

voidgimp_action_group_add_enum_actions (GimpActionGroup           *group,                                    const gchar               *msg_context,                                    const GimpEnumActionEntry *entries,                                    guint                      n_entries,                                    GCallback                  callback){  gint i;  g_return_if_fail (GIMP_IS_ACTION_GROUP (group));  for (i = 0; i < n_entries; i++)    {      GimpEnumAction *action;      const gchar    *label;      const gchar    *tooltip = NULL;      if (! gimp_action_group_check_unique_action (group, entries[i].name))        continue;      if (msg_context)        {          label = g_dpgettext2 (NULL, msg_context, entries[i].label);          if (entries[i].tooltip)            tooltip = g_dpgettext2 (NULL, msg_context, entries[i].tooltip);        }      else        {          label   = gettext (entries[i].label);          tooltip = gettext (entries[i].tooltip);        }      action = gimp_enum_action_new (entries[i].name, label, tooltip,                                     entries[i].icon_name,                                     entries[i].value,                                     entries[i].value_variable);      if (callback)        g_signal_connect (action, "selected",                          callback,                          group->user_data);      gtk_action_group_add_action_with_accel (GTK_ACTION_GROUP (group),                                              GTK_ACTION (action),                                              entries[i].accelerator);      g_signal_emit (group, signals[ACTION_ADDED], 0, action);      if (entries[i].help_id)        g_object_set_qdata_full (G_OBJECT (action), GIMP_HELP_ID,                                 g_strdup (entries[i].help_id),                                 (GDestroyNotify) g_free);      g_object_unref (action);    }}
开发者ID:davidyang5405,项目名称:gimp,代码行数:56,


示例19: seahorse_gpgme_key_actions_init

static voidseahorse_gpgme_key_actions_init (SeahorseGpgmeKeyActions *self){#ifdef WITH_KEYSERVER	GtkActionGroup *actions = GTK_ACTION_GROUP (self);	gtk_action_group_set_translation_domain (actions, GETTEXT_PACKAGE);	gtk_action_group_add_actions (actions, SYNC_ACTIONS,	                              G_N_ELEMENTS (SYNC_ACTIONS), NULL);#endif}
开发者ID:xZeroCooLx,项目名称:seahorse,代码行数:10,


示例20: main

int main(int argc, char *argv[]){    gtk_init(&argc, &argv);        GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);    gtk_window_set_default_size(GTK_WINDOW(window), 200, 200);    g_signal_connect(window, "destroy", G_CALLBACK(destroy), NULL);        GtkWidget *menubar = gtk_menu_bar_new();    gtk_container_add(GTK_CONTAINER(window), menubar);    GtkActionGroup *actiongroup = gtk_action_group_new("ActionGroup");        GtkAction *action = gtk_action_new("actionFile", "_File", NULL, NULL);    gtk_action_group_add_action(GTK_ACTION_GROUP(actiongroup), action);    GtkWidget *menuitemFile = gtk_action_create_menu_item(GTK_ACTION(action));    gtk_menu_bar_append(GTK_MENU_BAR(menubar), menuitemFile);        GtkWidget *menu = gtk_menu_new();    gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitemFile), menu);        GtkToggleAction *toggleaction;        toggleaction = gtk_toggle_action_new("actionNew", "_New", "Create a new document", GTK_STOCK_NEW);    gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(toggleaction), TRUE);    gtk_action_group_add_action(GTK_ACTION_GROUP(actiongroup), GTK_ACTION(toggleaction));    GtkWidget *menuitemNew = gtk_action_create_menu_item(GTK_ACTION(toggleaction));    gtk_menu_append(GTK_MENU(menu), menuitemNew);    toggleaction = gtk_toggle_action_new("actionOpen", "_Open", "Open a file", GTK_STOCK_OPEN);    gtk_action_group_add_action(GTK_ACTION_GROUP(actiongroup), GTK_ACTION(toggleaction));    GtkWidget *menuitemOpen = gtk_action_create_menu_item(GTK_ACTION(toggleaction));    gtk_menu_append(GTK_MENU(menu), menuitemOpen);    toggleaction = gtk_toggle_action_new("actionSave", "_Save", "Save a file", GTK_STOCK_SAVE);    gtk_action_group_add_action(GTK_ACTION_GROUP(actiongroup), GTK_ACTION(toggleaction));    GtkWidget *menuitemSave = gtk_action_create_menu_item(GTK_ACTION(toggleaction));    gtk_menu_append(GTK_MENU(menu), menuitemSave);    gtk_widget_show_all(window);        gtk_main();        return 0;}
开发者ID:RainMark,项目名称:gtk3-tutorial,代码行数:43,


示例21: _rb_source_register_action_group

/** * _rb_source_register_action_group: * @source: a #RBSource * @group_name: action group name * @actions: array of GtkActionEntry structures for the action group * @num_actions: number of actions in the @actions array * @user_data: user data to use for action signal handlers * * Creates and registers a GtkActionGroup for the source. * * Return value: the created action group */GtkActionGroup *_rb_source_register_action_group (RBSource *source,				  const char *group_name,				  GtkActionEntry *actions,				  int num_actions,				  gpointer user_data){	GtkUIManager *uimanager;	GList *actiongroups;	GList *i;	GtkActionGroup *group;	g_return_val_if_fail (group_name != NULL, NULL);	g_object_get (source, "ui-manager", &uimanager, NULL);	actiongroups = gtk_ui_manager_get_action_groups (uimanager);	/* Don't create the action group if it's already registered */	for (i = actiongroups; i != NULL; i = i->next) {		const char *name;		name = gtk_action_group_get_name (GTK_ACTION_GROUP (i->data));		if (name != NULL && strcmp (name, group_name) == 0) {			group = GTK_ACTION_GROUP (i->data);			/* Add a reference */			g_object_ref (group);			goto out;		}	}	group = gtk_action_group_new (group_name);	gtk_action_group_set_translation_domain (group,						 GETTEXT_PACKAGE);	gtk_action_group_add_actions (group,				      actions, num_actions,				      user_data);	gtk_ui_manager_insert_action_group (uimanager, group, 0); out:	g_object_unref (uimanager);	return group;}
开发者ID:ivankelly,项目名称:Rhythmbox-Spotify-Plugin,代码行数:55,


示例22: show_view_update_zoom_sensitivity

static voidshow_view_update_zoom_sensitivity (PlannerShowView *view){	gboolean in, out;	planner_gantt_chart_can_zoom (PLANNER_GANTT_CHART (view->priv->gantt),				      &in,				      &out);	g_object_set (gtk_action_group_get_action (GTK_ACTION_GROUP(view->priv->actions),						   "ZoomIn"),		      "sensitive", in,		      NULL);	g_object_set (gtk_action_group_get_action (GTK_ACTION_GROUP(view->priv->actions),						   "ZoomOut"),		      "sensitive", out,		      NULL);}
开发者ID:zsyyr,项目名称:PlannerWin,代码行数:19,


示例23: find_action_group

static GtkActionGroup *find_action_group (GtkUIManager *uimanager, const char *group_name){	GList *actiongroups;	GList *i;	actiongroups = gtk_ui_manager_get_action_groups (uimanager);	/* Don't create the action group if it's already registered */	for (i = actiongroups; i != NULL; i = i->next) {		const char *name;		name = gtk_action_group_get_name (GTK_ACTION_GROUP (i->data));		if (name != NULL && strcmp (name, group_name) == 0) {			return GTK_ACTION_GROUP (i->data);		}	}	return NULL;}
开发者ID:AdamZ,项目名称:rhythmbox-magnatune,代码行数:19,


示例24: update_menu_items

static voidupdate_menu_items (GObject    *gobject,                   GParamSpec *pspec,                   gpointer    user_data){	BluetoothApplet *applet = BLUETOOTH_APPLET (gobject);	gboolean enabled;	GObject *object;	enabled = bluetooth_applet_get_show_full_menu (applet);	object = gtk_builder_get_object (xml, "adapter-action-group");	gtk_action_group_set_visible (GTK_ACTION_GROUP (object), enabled);	gtk_action_group_set_visible (devices_action_group, enabled);	if (enabled == FALSE)		return;	gtk_action_group_set_sensitive (GTK_ACTION_GROUP (object), TRUE);}
开发者ID:mcmihail,项目名称:cinnamon-bluetooth,代码行数:20,


示例25: update_menu_items

static voidupdate_menu_items (void){	gboolean enabled;	GObject *object;	if (num_adapters_present == 0)		enabled = FALSE;	else		enabled = (num_adapters_present - num_adapters_powered) <= 0;	object = gtk_builder_get_object (xml, "adapter-action-group");	gtk_action_group_set_visible (GTK_ACTION_GROUP (object), enabled);	gtk_action_group_set_visible (devices_action_group, enabled);	if (enabled == FALSE)		return;	gtk_action_group_set_sensitive (GTK_ACTION_GROUP (object), TRUE);}
开发者ID:cummins-cvp,项目名称:mate-bluetooth,代码行数:20,


示例26: windows_actions_recent_remove

static voidwindows_actions_recent_remove (GimpContainer   *container,                               GimpSessionInfo *info,                               GimpActionGroup *group){  GtkAction *action;  gint       info_id;  gchar     *action_name;  info_id = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (info),                                                "recent-action-id"));  action_name = g_strdup_printf ("windows-recent-%04d", info_id);  action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), action_name);  if (action)    gtk_action_group_remove_action (GTK_ACTION_GROUP (group), action);  g_free (action_name);}
开发者ID:1ynx,项目名称:gimp,代码行数:21,


示例27: find_action_group

static GtkActionGroup *find_action_group (GtkUIManager *manager,		   const char *name){	GList *list, *element;	list = gtk_ui_manager_get_action_groups (manager);	element = g_list_find_custom (list, name, (GCompareFunc) find_name);	g_return_val_if_fail (element != NULL, NULL);	return GTK_ACTION_GROUP (element->data);}
开发者ID:jdapena,项目名称:epiphany,代码行数:12,


示例28: gimp_ui_manager_find_action

GtkAction *gimp_ui_manager_find_action (GimpUIManager *manager,                             const gchar   *group_name,                             const gchar   *action_name){  GimpActionGroup *group;  GtkAction       *action = NULL;  g_return_val_if_fail (GIMP_IS_UI_MANAGER (manager), NULL);  g_return_val_if_fail (action_name != NULL, NULL);  if (group_name)    {      group = gimp_ui_manager_get_action_group (manager, group_name);      if (group)        action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),                                              action_name);    }  else    {      GList *list;      for (list = gtk_ui_manager_get_action_groups (GTK_UI_MANAGER (manager));           list;           list = g_list_next (list))        {          group = list->data;          action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),                                                action_name);          if (action)            break;        }    }  return action;}
开发者ID:AnonPower,项目名称:picman,代码行数:39,


示例29: usage_view_update_zoom_sensitivity

static voidusage_view_update_zoom_sensitivity (PlannerView *view){	PlannerUsageViewPriv *priv;        gboolean              in, out;	priv = PLANNER_USAGE_VIEW (view)->priv;        planner_usage_chart_can_zoom (priv->chart, &in, &out);	g_object_set (gtk_action_group_get_action (			      GTK_ACTION_GROUP (priv->actions),			      "ZoomIn"),		      "sensitive", in,		      NULL);	g_object_set (gtk_action_group_get_action (			      GTK_ACTION_GROUP (priv->actions),			      "ZoomOut"),		      "sensitive", out,		      NULL);}
开发者ID:00willo,项目名称:planner,代码行数:22,


示例30: seahorse_pgp_backend_actions_init

static voidseahorse_pgp_backend_actions_init (SeahorsePgpBackendActions *self){#ifdef WITH_KEYSERVER	GtkActionGroup *actions = GTK_ACTION_GROUP (self);	gtk_action_group_set_translation_domain (actions, GETTEXT_PACKAGE);	gtk_action_group_add_actions (actions, FIND_ACTIONS,	                              G_N_ELEMENTS (FIND_ACTIONS), NULL);	gtk_action_group_add_actions (actions, SYNC_ACTIONS,	                              G_N_ELEMENTS (SYNC_ACTIONS), self);	seahorse_actions_register_definition (SEAHORSE_ACTIONS (self), BACKEND_DEFINITION);#endif}
开发者ID:xZeroCooLx,项目名称:seahorse,代码行数:13,



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


C++ GTK_ALIGNMENT函数代码示例
C++ GTK_ACTION函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。