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

C++ GTK_ACTION_GROUP函数代码示例

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

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



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

示例1: plug_in_actions_unregister_procedure

static void
plug_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,代码来源:plug-in-actions.c


示例2: tool_options_actions_update_presets

static void
tool_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,代码来源:tool-options-actions.c


示例3: edit_actions_setup

void
edit_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,代码来源:edit-actions.c


示例4: windows_actions_dock_window_removed

static void
windows_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,代码来源:windows-actions.c


示例5: gimp_action_group_set_action_active

void
gimp_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,代码来源:gimpactiongroup.c


示例6: gimp_action_group_dispose

static void
gimp_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,代码来源:gimpactiongroup.c


示例7: gimp_action_group_constructed

static void
gimp_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,代码来源:gimpactiongroup.c


示例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,代码来源:menus.c


示例9: clip_GTK_ACTIONGROUPTRANSLATESTRING

int
clip_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,代码来源:actiongroup.c


示例10: clip_GTK_ACTIONGROUPSETTRANSLATEFUNC

int
clip_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,代码来源:actiongroup.c


示例11: clip_GTK_ACTIONGROUPGETACTION

int
clip_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,代码来源:actiongroup.c


示例12: gimp_action_group_set_action_viewable

void
gimp_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,代码来源:gimpactiongroup.c


示例13: gimp_action_group_check_unique_action

static gboolean
gimp_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,代码来源:gimpactiongroup.c


示例14: windows_actions_display_remove

static void
windows_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,代码来源:windows-actions.c


示例15: window_actions_display_closed

static void
window_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,代码来源:window-actions.c


示例16: plug_in_actions_build_path

static void
plug_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,代码来源:plug-in-actions.c


示例17: window_actions_update

void
window_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,代码来源:window-actions.c


示例18: gimp_action_group_add_enum_actions

void
gimp_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,代码来源:gimpactiongroup.c


示例19: seahorse_gpgme_key_actions_init

static void
seahorse_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,代码来源:seahorse-pgp-actions.c


示例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,代码来源:toggleaction.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GTK_ALIGNMENT函数代码示例发布时间:2022-05-30
下一篇:
C++ GTK_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