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

C++ GTK_ACTION函数代码示例

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

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



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

示例1: git_delete_branches_pane_init

static void
git_delete_branches_pane_init (GitDeleteBranchesPane *self)
{
	gchar *objects[] = {"delete_branches_pane",
						"ok_action",
						"cancel_action",
						NULL};
	GError *error = NULL;
	GtkAction *ok_action;
	GtkAction *cancel_action;

	self->priv = g_new0 (GitDeleteBranchesPanePriv, 1);
	self->priv->builder = gtk_builder_new ();

	if (!gtk_builder_add_objects_from_file (self->priv->builder, BUILDER_FILE, 
	                                        objects, 
	                                        &error))
	{
		g_warning ("Couldn't load builder file: %s", error->message);
		g_error_free (error);
	}

	ok_action = GTK_ACTION (gtk_builder_get_object (self->priv->builder,
	                                                "ok_action"));
	cancel_action = GTK_ACTION (gtk_builder_get_object (self->priv->builder,
	                                                "cancel_action"));

	g_signal_connect (G_OBJECT (ok_action), "activate",
	                  G_CALLBACK (on_ok_action_activated),
	                  self);

	g_signal_connect_swapped (G_OBJECT (cancel_action), "activate",
	                          G_CALLBACK (git_pane_remove_from_dock),
	                          self);
}
开发者ID:VujinovM,项目名称:anjuta,代码行数:35,代码来源:git-delete-branches-pane.c


示例2: activate_plugin

static gboolean activate_plugin(AnjutaPlugin *plugin) {
    AnjutaUI *ui;
    PlaylistDisplayPlugin *playlist_display_plugin;
    GtkActionGroup* action_group;
    GtkAction *new_playlist_action;
    GtkAction *load_ipods_action;

    /* Set preferences */
    set_default_preferences();

    /* Prepare the icons for the playlist */
    register_icon_path(get_plugin_dir(), "playlist_display");
    register_stock_icon(PREFERENCE_ICON, PREFERENCE_ICON_STOCK_ID);

    register_stock_icon("playlist_display-photo", PLAYLIST_DISPLAY_PHOTO_ICON_STOCK_ID);
    register_stock_icon("playlist_display-playlist", PLAYLIST_DISPLAY_PLAYLIST_ICON_STOCK_ID);
    register_stock_icon("playlist_display-read", PLAYLIST_DISPLAY_READ_ICON_STOCK_ID);
    register_stock_icon("playlist_display-add-dirs", PLAYLIST_DISPLAY_ADD_DIRS_ICON_STOCK_ID);
    register_stock_icon("playlist_display-add-files", PLAYLIST_DISPLAY_ADD_FILES_ICON_STOCK_ID);
    register_stock_icon("playlist_display-add-playlists", PLAYLIST_DISPLAY_ADD_PLAYLISTS_ICON_STOCK_ID);
    register_stock_icon("playlist_display-sync", PLAYLIST_DISPLAY_SYNC_ICON_STOCK_ID);

    playlist_display_plugin = (PlaylistDisplayPlugin*) plugin;
    ui = anjuta_shell_get_ui(plugin->shell, NULL);

    /* Add our playlist_actions */
    action_group
        = anjuta_ui_add_action_group_entries(ui, "ActionGroupPlaylistDisplay", _("Playlist Display"), playlist_actions, G_N_ELEMENTS (playlist_actions), GETTEXT_PACKAGE, TRUE, plugin);
    playlist_display_plugin->action_group = action_group;

    new_playlist_action = tool_menu_action_new (ACTION_NEW_PLAYLIST, _("New Playlist"), _("Create a new playlist for the selected iPod"), GTK_STOCK_NEW);
    g_signal_connect(new_playlist_action, "activate", G_CALLBACK(on_new_playlist_activate), NULL);
    gtk_action_group_add_action (playlist_display_plugin->action_group, GTK_ACTION (new_playlist_action));

    load_ipods_action = tool_menu_action_new (ACTION_DISPLAY_LOAD_IPODS, _("Load iPods"), _("Load all or selected iPods"), PLAYLIST_DISPLAY_READ_ICON_STOCK_ID);
    g_signal_connect(load_ipods_action, "activate", G_CALLBACK(on_load_ipods_mi), NULL);
    gtk_action_group_add_action (playlist_display_plugin->action_group, GTK_ACTION (load_ipods_action));

    /* Merge UI */
    gchar *uipath = g_build_filename(get_ui_dir(), "playlist_display.ui", NULL);
    playlist_display_plugin->uiid = anjuta_ui_merge(ui, uipath);
    g_free(uipath);

    playlist_display_plugin->playlist_view = pm_create_playlist_view(action_group);

    g_signal_connect (gtkpod_app, SIGNAL_PLAYLIST_ADDED, G_CALLBACK (playlist_display_playlist_added_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_PLAYLIST_REMOVED, G_CALLBACK (playlist_display_playlist_removed_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_ITDB_ADDED, G_CALLBACK (playlist_display_itdb_added_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_ITDB_REMOVED, G_CALLBACK (playlist_display_itdb_removed_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_ITDB_UPDATED, G_CALLBACK (playlist_display_update_itdb_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_PREFERENCE_CHANGE, G_CALLBACK (playlist_display_preference_changed_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_ITDB_DATA_CHANGED, G_CALLBACK (playlist_display_itdb_data_changed_cb), NULL);
    g_signal_connect (gtkpod_app, SIGNAL_ITDB_DATA_SAVED, G_CALLBACK (playlist_display_itdb_data_changed_cb), NULL);

    gtk_widget_show_all(playlist_display_plugin->playlist_view);
    // Add widget directly as scrolling is handled internally by the widget
    anjuta_shell_add_widget(plugin->shell, playlist_display_plugin->playlist_view, "PlaylistDisplayPlugin", _("  iPod Repositories"), PLAYLIST_DISPLAY_PLAYLIST_ICON_STOCK_ID, ANJUTA_SHELL_PLACEMENT_LEFT, NULL);

    return TRUE; /* FALSE if activation failed */
}
开发者ID:Sprezzatech,项目名称:gtkpod,代码行数:60,代码来源:plugin.c


示例3: glide_window_slide_changed_cb

static void
glide_window_slide_changed_cb (GObject *object,
			       GParamSpec *pspec,
			       gpointer user_data)
{
  GlideWindow *w = (GlideWindow *) user_data;
  GlideSlide *s = glide_document_get_nth_slide (w->priv->document,
						glide_stage_manager_get_current_slide (w->priv->manager));
  gint i;
  
  glide_window_update_slide_label (w);
  glide_window_animation_box_set_animation (w, glide_slide_get_animation (s));
  
  i = glide_stage_manager_get_current_slide (w->priv->manager);

  gtk_action_set_sensitive (GTK_ACTION (GLIDE_WINDOW_UI_OBJECT (w, "next-slide-action")), TRUE);
  gtk_action_set_sensitive (GTK_ACTION (GLIDE_WINDOW_UI_OBJECT (w, "prev-slide-action")), TRUE);
  
  if (i + 1 >= glide_document_get_n_slides (w->priv->document))
    {
      gtk_action_set_sensitive (GTK_ACTION (GLIDE_WINDOW_UI_OBJECT (w, "next-slide-action")), FALSE);
    }
  if (i == 0)
    {
      gtk_action_set_sensitive (GTK_ACTION (GLIDE_WINDOW_UI_OBJECT (w, "prev-slide-action")), FALSE);
    }
}
开发者ID:racarr,项目名称:Glide,代码行数:27,代码来源:glide-window.c


示例4: actions_toggle_add

void
actions_toggle_add(GtkActionGroup *act_group, const struct _actionhooks *ahs,
    int count)
{
	int i;
	GtkToggleAction *action;
	char *nel = malloc(max_path);

	for (i = 0; i < count; i++) {
		char *label = gettext(ahs[i].label);
		action = gtk_toggle_action_new(ahs[i].name,
		  label, ahs[i].tooltip == NULL ? label :
		  gettext(ahs[i].tooltip),
		  ahs[i].icon == NULL ? ahs[i].name : ahs[i].icon);
		sprintf(nel, "<Actions>/actions/%s", ahs[i].name);
		gtk_action_set_accel_path(GTK_ACTION(action), nel);
		//gtk_action_connect_accelerator(action);
		g_signal_connect(G_OBJECT(action), "activate",
		    ahs[i].handler,
		    GINT_TO_POINTER(ahs[i].parameter));
		gtk_action_group_add_action_with_accel(act_group,
		    GTK_ACTION(action),
		  NULL);
	}
	free(nel);
}
开发者ID:petesh,项目名称:pocketcity,代码行数:26,代码来源:main.c


示例5: update_discoverability

static void
update_discoverability (GtkTreeIter *iter)
{
	gboolean discoverable;
	GObject *object;

	/* Avoid loops from changing the UI */
	if (discover_lock != FALSE)
		return;

	discover_lock = TRUE;

	object = gtk_builder_get_object (xml, "discoverable");

	if (iter == NULL) {
		discover_lock = FALSE;
		gtk_action_set_visible (GTK_ACTION (object), FALSE);
		return;
	}

	gtk_tree_model_get (devices_model, iter,
			    BLUETOOTH_COLUMN_DISCOVERABLE, &discoverable,
			    -1);

	gtk_action_set_visible (GTK_ACTION (object), TRUE);
	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (object), discoverable);

	discover_lock = FALSE;
}
开发者ID:cummins-cvp,项目名称:mate-bluetooth,代码行数:29,代码来源:main.c


示例6: nemo_action_set_tt

void
nemo_action_set_tt (NemoAction *action, NemoFile *file)
{
    const gchar *orig_tt = nemo_action_get_orig_tt (action);

    if (!test_string_for_label_token (orig_tt) || file == NULL ||
        action->selection_type != SELECTION_SINGLE) {
        gtk_action_set_tooltip (GTK_ACTION (action), orig_tt);
        return;
    }

    gchar *display_name = nemo_file_get_display_name (file);

    gchar **split = g_strsplit (orig_tt, TOKEN_LABEL_FILE_NAME, 2);

    gchar *new_tt = g_strconcat (split[0], display_name, split[1], NULL);

    gchar *escaped = eel_str_double_underscores (new_tt);

    gtk_action_set_tooltip (GTK_ACTION (action), escaped);

    g_strfreev (split);
    g_free (display_name);
    g_free (new_tt);
    g_free (escaped);
}
开发者ID:BadioO,项目名称:nemo,代码行数:26,代码来源:nemo-action.c


示例7: build_menu

static void
build_menu (NemoBlankDesktopWindow *window)
{
    if (window->details->popup_menu) {
        return;
    }

    NemoActionManager *desktop_action_manager = nemo_desktop_manager_get_action_manager ();

    if (window->details->actions_changed_id == 0) {
        window->details->actions_changed_id = g_signal_connect_swapped (desktop_action_manager,
                                                                        "changed",
                                                                        G_CALLBACK (actions_changed_cb),
                                                                        window);
    }

    GList *action_list = nemo_action_manager_list_actions (desktop_action_manager);

    if (g_list_length (action_list) == 0)
        return;

    window->details->popup_menu = gtk_menu_new ();

    gboolean show;
    g_object_get (gtk_settings_get_default (), "gtk-menu-images", &show, NULL);

    gtk_menu_attach_to_widget (GTK_MENU (window->details->popup_menu),
                               GTK_WIDGET (window),
                               NULL);

    GtkWidget *item;
    GList *l;
    NemoAction *action;

    for (l = action_list; l != NULL; l = l->next) {
        action = l->data;

        if (action->show_in_blank_desktop && action->dbus_satisfied) {
            gchar *label = nemo_action_get_label (action, NULL, NULL);
            item = gtk_image_menu_item_new_with_mnemonic (label);
            g_free (label);

            const gchar *stock_id = gtk_action_get_stock_id (GTK_ACTION (action));
            const gchar *icon_name = gtk_action_get_icon_name (GTK_ACTION (action));

            if (stock_id || icon_name) {
                GtkWidget *image = stock_id ? gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_MENU) :
                                              gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);

                gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
                gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (item), show);
            }

            gtk_widget_set_visible (item, TRUE);
            g_signal_connect (item, "activate", G_CALLBACK (action_activated_callback), action);
            gtk_menu_shell_append (GTK_MENU_SHELL (window->details->popup_menu), item);
        }
    }
}
开发者ID:daschuer,项目名称:nemo,代码行数:59,代码来源:nemo-blank-desktop-window.c


示例8: pragha_system_titlebar_changed_cb

static void
pragha_system_titlebar_changed_cb (PraghaPreferences *preferences, GParamSpec *pspec, PraghaApplication *pragha)
{
	PraghaToolbar *toolbar;
	GtkWidget *window, *parent, *menubar;
	GtkAction *action;

	window = pragha_application_get_window (pragha);
	toolbar = pragha_application_get_toolbar (pragha);
	menubar = pragha_application_get_menubar (pragha);
	g_object_ref(toolbar);

	parent  = gtk_widget_get_parent (GTK_WIDGET(menubar));

	if (pragha_preferences_get_system_titlebar (preferences)) {
		gtk_widget_hide(GTK_WIDGET(window));

		action = pragha_application_get_menu_action (pragha,
			"/Menubar/ViewMenu/Fullscreen");
		gtk_action_set_sensitive (GTK_ACTION (action), TRUE);

		action = pragha_application_get_menu_action (pragha,
			"/Menubar/ViewMenu/Playback controls below");
		gtk_action_set_sensitive (GTK_ACTION (action), TRUE);

		gtk_window_set_titlebar (GTK_WINDOW (window), NULL);
		gtk_window_set_title (GTK_WINDOW(window), _("Pragha Music Player"));

		gtk_box_pack_start (GTK_BOX(parent), GTK_WIDGET(toolbar),
		                    FALSE, FALSE, 0);
		gtk_box_reorder_child(GTK_BOX(parent), GTK_WIDGET(toolbar), 1);

		pragha_toolbar_set_style(toolbar, TRUE);

		gtk_widget_show(GTK_WIDGET(window));

	}
	else {
		gtk_widget_hide(GTK_WIDGET(window));

		pragha_preferences_set_controls_below(preferences, FALSE);

		action = pragha_application_get_menu_action (pragha,
			"/Menubar/ViewMenu/Fullscreen");
		gtk_action_set_sensitive (GTK_ACTION (action), FALSE);

		action = pragha_application_get_menu_action (pragha,
			"/Menubar/ViewMenu/Playback controls below");
		gtk_action_set_sensitive (GTK_ACTION (action), FALSE);

		gtk_container_remove (GTK_CONTAINER(parent), GTK_WIDGET(toolbar));
		gtk_window_set_titlebar (GTK_WINDOW (window), GTK_WIDGET(toolbar));

		pragha_toolbar_set_style(toolbar, FALSE);

		gtk_widget_show(GTK_WIDGET(window));
	}
	g_object_unref(toolbar);
}
开发者ID:pragha-music-player,项目名称:pragha,代码行数:59,代码来源:pragha.c


示例9: nautilus_window_create_toolbar_action_group

GtkActionGroup *
nautilus_window_create_toolbar_action_group (NautilusWindow *window)
{
	NautilusNavigationState *navigation_state;
	GtkActionGroup *action_group;
	GtkAction *action;

	action_group = gtk_action_group_new ("ToolbarActions");
	gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);

	action = g_object_new (NAUTILUS_TYPE_NAVIGATION_ACTION,
			       "name", NAUTILUS_ACTION_BACK,
			       "label", _("_Back"),
			       "stock_id", GTK_STOCK_GO_BACK,
			       "tooltip", _("Go to the previous visited location"),
			       "arrow-tooltip", _("Back history"),
			       "window", window,
			       "direction", NAUTILUS_NAVIGATION_DIRECTION_BACK,
			       "sensitive", FALSE,
			       NULL);
	g_signal_connect (action, "activate",
			  G_CALLBACK (action_back_callback), window);
	gtk_action_group_add_action (action_group, action);

	g_object_unref (action);

	action = g_object_new (NAUTILUS_TYPE_NAVIGATION_ACTION,
			       "name", NAUTILUS_ACTION_FORWARD,
			       "label", _("_Forward"),
			       "stock_id", GTK_STOCK_GO_FORWARD,
			       "tooltip", _("Go to the next visited location"),
			       "arrow-tooltip", _("Forward history"),
			       "window", window,
			       "direction", NAUTILUS_NAVIGATION_DIRECTION_FORWARD,
			       "sensitive", FALSE,
			       NULL);
	g_signal_connect (action, "activate",
			  G_CALLBACK (action_forward_callback), window);
	gtk_action_group_add_action (action_group, action);

	g_object_unref (action);

	action = GTK_ACTION
		(gtk_toggle_action_new (NAUTILUS_ACTION_SEARCH,
					_("Search"),
					_("Search documents and folders by name"),
					NULL));
	gtk_action_group_add_action (action_group, action);
	gtk_action_set_icon_name (GTK_ACTION (action), "edit-find-symbolic");
	gtk_action_set_is_important (GTK_ACTION (action), TRUE);

	g_object_unref (action);

	navigation_state = nautilus_window_get_navigation_state (window);
	nautilus_navigation_state_add_group (navigation_state, action_group);

	return action_group;
}
开发者ID:bakatz,项目名称:nautilus,代码行数:58,代码来源:nautilus-window-menus.c


示例10: killswitch_state_changed

static void
killswitch_state_changed (GObject    *gobject,
                          GParamSpec *pspec,
                          gpointer    user_data)
{
	GObject *object;
	BluetoothApplet *applet = BLUETOOTH_APPLET (gobject);
	BluetoothKillswitchState state = bluetooth_applet_get_killswitch_state (applet);
	gboolean sensitive = TRUE;
	gboolean bstate = FALSE;
	const char *label, *status_label;

	if (state == BLUETOOTH_KILLSWITCH_STATE_NO_ADAPTER) {
		object = gtk_builder_get_object (xml, "bluetooth-applet-popup");
		gtk_menu_popdown (GTK_MENU (object));
		update_icon_visibility ();
		return;
	}

	if (state == BLUETOOTH_KILLSWITCH_STATE_SOFT_BLOCKED) {
		label = N_("Turn on Bluetooth");
		status_label = N_("Bluetooth: Off");
		bstate = FALSE;
	} else if (state == BLUETOOTH_KILLSWITCH_STATE_UNBLOCKED) {
		label = N_("Turn off Bluetooth");
		status_label = N_("Bluetooth: On");
		bstate = TRUE;
	} else if (state == BLUETOOTH_KILLSWITCH_STATE_HARD_BLOCKED) {
		sensitive = FALSE;
		label = NULL;
		status_label = N_("Bluetooth: Disabled");
	} else {
		g_assert_not_reached ();
	}

	object = gtk_builder_get_object (xml, "killswitch-label");
	gtk_action_set_label (GTK_ACTION (object), _(status_label));
	gtk_action_set_visible (GTK_ACTION (object), TRUE);

	object = gtk_builder_get_object (xml, "killswitch");
	gtk_action_set_visible (GTK_ACTION (object), sensitive);
	gtk_action_set_label (GTK_ACTION (object), _(label));

	if (sensitive != FALSE) {
		gtk_action_set_label (GTK_ACTION (object), _(label));
		g_object_set_data (object, "bt-active", GINT_TO_POINTER (bstate));
	}

	object = gtk_builder_get_object (xml, "bluetooth-applet-ui-manager");
	gtk_ui_manager_ensure_update (GTK_UI_MANAGER (object));

	update_icon_visibility ();
}
开发者ID:mcmihail,项目名称:cinnamon-bluetooth,代码行数:53,代码来源:main.c


示例11: games_pause_action_set_is_paused

void
games_pause_action_set_is_paused (GamesPauseAction *action, gboolean is_paused)
{
    g_return_if_fail (GAMES_IS_PAUSE_ACTION (action));

    if ((action->priv->is_paused && is_paused) || (!action->priv->is_paused && !is_paused))
        return;
    action->priv->is_paused = is_paused;
    if (is_paused)
        gtk_action_set_stock_id (GTK_ACTION (action), GAMES_STOCK_RESUME_GAME);
    else
        gtk_action_set_stock_id (GTK_ACTION (action), GAMES_STOCK_PAUSE_GAME);
    g_object_notify (G_OBJECT (action), "is-paused");
    g_signal_emit (G_OBJECT (action), signals[STATE_CHANGED], 0);
}
开发者ID:Swetha5,项目名称:gnome-games,代码行数:15,代码来源:games-pause-action.c


示例12: gtk_builder_new

static GtkWidget *create_popupmenu(void)
{
	GObject *object;
	GError *error = NULL;

	xml = gtk_builder_new ();
	if (gtk_builder_add_from_file (xml, "popup-menu.ui", &error) == 0) {
		if (error->domain == GTK_BUILDER_ERROR) {
			g_warning ("Failed to load popup-menu.ui: %s", error->message);
			g_error_free (error);
			return NULL;
		}
		g_error_free (error);
		error = NULL;
		if (gtk_builder_add_from_file (xml, PKGDATADIR "/popup-menu.ui", &error) == 0) {
			g_warning ("Failed to load popup-menu.ui: %s", error->message);
			g_error_free (error);
			return NULL;
		}
	}

	gtk_builder_connect_signals (xml, NULL);

	if (bluetooth_applet_get_killswitch_state (applet) != BLUETOOTH_KILLSWITCH_STATE_NO_ADAPTER) {
		GObject *object;

		object = gtk_builder_get_object (xml, "killswitch-label");
		gtk_action_set_visible (GTK_ACTION (object), TRUE);
	}

	if (option_debug != FALSE) {
		GObject *object;

		object = gtk_builder_get_object (xml, "quit");
		gtk_action_set_visible (GTK_ACTION (object), TRUE);
	}

	object = gtk_builder_get_object (xml, "bluetooth-applet-ui-manager");
	devices_action_group = gtk_action_group_new ("devices-action-group");
	gtk_ui_manager_insert_action_group (GTK_UI_MANAGER (object),
					    devices_action_group, -1);

	action_set_bold (GTK_UI_MANAGER (object),
			 GTK_ACTION (gtk_builder_get_object (xml, "devices-label")),
			 "/bluetooth-applet-popup/devices-label");

	return GTK_WIDGET (gtk_builder_get_object (xml, "bluetooth-applet-popup"));
}
开发者ID:mcmihail,项目名称:cinnamon-bluetooth,代码行数:48,代码来源:main.c


示例13: create_menu_item

static GtkWidget *
create_menu_item (GtkAction* action) {
  GtkWidget* menu;
  GtkWidget* menu_item;
  GList* actions = XDIFF_EXT_SUBMENU_ACTION(action)->actions;

  menu = gtk_menu_new ();
  
  while(actions) {
    GtkAction* a = GTK_ACTION(actions->data);
    
    if(a != NULL) {
      menu_item = gtk_action_create_menu_item(a);
      gtk_widget_show(menu_item);
      gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
    } else {
      GtkWidget* s = gtk_separator_menu_item_new();
      gtk_widget_show(s);
      gtk_menu_shell_append(GTK_MENU_SHELL(menu), s);
    }
    
    actions = g_list_next(actions);
  }

  gtk_widget_show(menu);

  menu_item = GTK_ACTION_CLASS(parent_class)->create_menu_item(action);

  gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), menu);

  gtk_widget_show(menu_item);

  return menu_item;
}
开发者ID:jmenashe,项目名称:diff-ext,代码行数:34,代码来源:submenu-action.c


示例14: empathy_mic_menu_add_microphone

static void
empathy_mic_menu_add_microphone (EmpathyMicMenu *self,
    const gchar *name,
    const gchar *description,
    guint source_idx,
    gboolean is_monitor)
{
  EmpathyMicMenuPrivate *priv = self->priv;
  GtkRadioAction *action;
  GSList *group;

  action = gtk_radio_action_new (name, description, NULL, NULL, source_idx);
  gtk_action_group_add_action_with_accel (priv->action_group,
      GTK_ACTION (action), NULL);

  /* Set MONITOR_KEY on the action to non-NULL if it's a monitor
   * because we don't want to show monitors if we can help it. */
  if (is_monitor)
    {
      g_object_set_data (G_OBJECT (action), MONITOR_KEY,
          GUINT_TO_POINTER (TRUE));
    }

  group = gtk_radio_action_get_group (GTK_RADIO_ACTION (priv->anchor_action));
  gtk_radio_action_set_group (GTK_RADIO_ACTION (action), group);

  g_queue_push_tail (priv->microphones, action);

  g_signal_connect (action, "activate",
      G_CALLBACK (empathy_mic_menu_activate_cb), self);
}
开发者ID:DylanMcCall,项目名称:Empathy---Hide-contact-groups,代码行数:31,代码来源:empathy-mic-menu.c


示例15: rg_remove_action

static VALUE
rg_remove_action(VALUE self, VALUE action)
{
    gtk_action_group_remove_action(_SELF(self), GTK_ACTION(RVAL2GOBJ(action)));
    G_CHILD_REMOVE(self, action);
    return self;
}
开发者ID:msakai,项目名称:ruby-gnome2,代码行数:7,代码来源:rbgtkactiongroup.c


示例16: create_game_menus

/**
 * create_game_menus
 * @ap: application pointer
 *
 * Description:
 * Creates the menus for application @ap
 *
 **/
void
create_game_menus (GtkUIManager * ui_manager)
{

  GtkActionGroup *action_group;
  games_stock_init ();

  action_group = gtk_action_group_new ("actions");

  gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);
  gtk_action_group_add_actions (action_group, action_entry,
				G_N_ELEMENTS (action_entry), app);
  gtk_action_group_add_toggle_actions (action_group, toggle_action_entry,
				       G_N_ELEMENTS (toggle_action_entry),
				       app);

  gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
  gtk_ui_manager_add_ui_from_string (ui_manager, ui_description, -1, NULL);

  scores_action = gtk_action_group_get_action (action_group, "Scores");
  teleport_action = gtk_action_group_get_action (action_group, "Teleport");
  random_action = gtk_action_group_get_action (action_group, "Random");
  wait_action = gtk_action_group_get_action (action_group, "Wait");
  toolbar_toggle_action =
    gtk_action_group_get_action (action_group, "ShowToolbar");
  fullscreen_action = GTK_ACTION (games_fullscreen_action_new ("Fullscreen", GTK_WINDOW (app)));
  gtk_action_group_add_action_with_accel (action_group, fullscreen_action, NULL);

  return;
}
开发者ID:rcdun,项目名称:gnome-robots-commit-fix,代码行数:38,代码来源:menu.c


示例17: empathy_mic_menu_microphone_removed_cb

static void
empathy_mic_menu_microphone_removed_cb (EmpathyMicMonitor *monitor,
    guint source_idx,
    EmpathyMicMenu *self)
{
  EmpathyMicMenuPrivate *priv = self->priv;
  GList *l;

  for (l = priv->microphones->head; l != NULL; l = l->next)
    {
      GtkRadioAction *action = l->data;
      gint value;

      g_object_get (action, "value", &value, NULL);

      if (value != (gint) source_idx)
        {
          action = NULL;
          continue;
        }

      g_signal_handlers_disconnect_by_func (action,
          G_CALLBACK (empathy_mic_menu_activate_cb), self);

      gtk_action_group_remove_action (priv->action_group, GTK_ACTION (action));
      g_queue_remove (priv->microphones, action);
      break;
    }

  empathy_mic_menu_update (self);
}
开发者ID:DylanMcCall,项目名称:Empathy---Hide-contact-groups,代码行数:31,代码来源:empathy-mic-menu.c


示例18: shell_searchbar_save_search_filter

static void
shell_searchbar_save_search_filter (EShellSearchbar *searchbar)
{
	EShellView *shell_view;
	EActionComboBox *action_combo_box;
	GtkRadioAction *radio_action;
	GKeyFile *key_file;
	const gchar *action_name;
	const gchar *state_group;
	const gchar *key;

	shell_view = e_shell_searchbar_get_shell_view (searchbar);
	state_group = e_shell_searchbar_get_state_group (searchbar);
	g_return_if_fail (state_group != NULL);

	key = STATE_KEY_SEARCH_FILTER;
	key_file = e_shell_view_get_state_key_file (shell_view);

	action_combo_box = e_shell_searchbar_get_filter_combo_box (searchbar);
	radio_action = e_action_combo_box_get_action (action_combo_box);

	if (radio_action != NULL)
		radio_action = e_radio_action_get_current_action (radio_action);

	if (radio_action != NULL) {
		action_name = gtk_action_get_name (GTK_ACTION (radio_action));
		g_key_file_set_string (key_file, state_group, key, action_name);
	} else
		g_key_file_remove_key (key_file, state_group, key, NULL);

	e_shell_view_set_state_dirty (shell_view);
}
开发者ID:jdapena,项目名称:evolution,代码行数:32,代码来源:e-shell-searchbar.c


示例19: view_ui_item_toggled_cb

/*---------------------------------------------------------------------------*/
static void
view_ui_item_toggled_cb (GtkToggleAction *action,
			 GtkUIManager    *ui)
{
	const gchar *name;
	gboolean     state;

	gl_debug (DEBUG_UI, "START");

	g_return_if_fail (action && GTK_IS_TOGGLE_ACTION (action));

	name  = gtk_action_get_name (GTK_ACTION (action));
	state = gtk_toggle_action_get_active (action);

	gl_debug (DEBUG_UI, "Action = %s, State = %d", name, state);

	if (strcmp (name, "ViewMainToolBar") == 0)
	{
                gl_prefs_model_set_main_toolbar_visible (gl_prefs, state);
		set_app_main_toolbar_style (ui);
	}

	if (strcmp (name, "ViewDrawingToolBar") == 0)
	{
		gl_prefs_model_set_drawing_toolbar_visible (gl_prefs, state);
		set_app_drawing_toolbar_style (ui);
	}

	gl_debug (DEBUG_UI, "");
}
开发者ID:samlown,项目名称:glabels,代码行数:31,代码来源:ui.c


示例20: shell_searchbar_save_search_scope

static void
shell_searchbar_save_search_scope (EShellSearchbar *searchbar)
{
	EShellView *shell_view;
	EActionComboBox *action_combo_box;
	GtkRadioAction *radio_action;
	GKeyFile *key_file;
	const gchar *action_name;
	const gchar *state_group;
	const gchar *key;

	shell_view = e_shell_searchbar_get_shell_view (searchbar);

	/* Search scope is hard-coded to the default state group. */
	state_group = STATE_GROUP_DEFAULT;

	key = STATE_KEY_SEARCH_SCOPE;
	key_file = e_shell_view_get_state_key_file (shell_view);

	action_combo_box = e_shell_searchbar_get_scope_combo_box (searchbar);
	radio_action = e_action_combo_box_get_action (action_combo_box);

	if (radio_action != NULL)
		radio_action = e_radio_action_get_current_action (radio_action);

	if (radio_action != NULL) {
		action_name = gtk_action_get_name (GTK_ACTION (radio_action));
		g_key_file_set_string (key_file, state_group, key, action_name);
	} else
		g_key_file_remove_key (key_file, state_group, key, NULL);

	e_shell_view_set_state_dirty (shell_view);
}
开发者ID:jdapena,项目名称:evolution,代码行数:33,代码来源:e-shell-searchbar.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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