當前位置: 首頁>>代碼示例>>C++>>正文


C++ GTK_TOGGLE_ACTION函數代碼示例

本文整理匯總了C++中GTK_TOGGLE_ACTION函數的典型用法代碼示例。如果您正苦於以下問題:C++ GTK_TOGGLE_ACTION函數的具體用法?C++ GTK_TOGGLE_ACTION怎麽用?C++ GTK_TOGGLE_ACTION使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GTK_TOGGLE_ACTION函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: action_show_hidden_files_callback

static void
action_show_hidden_files_callback (GtkAction *action, 
				   gpointer callback_data)
{
	NautilusWindow *window;
	NautilusWindowShowHiddenFilesMode mode;

	window = NAUTILUS_WINDOW (callback_data);

	if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))) {
		mode = NAUTILUS_WINDOW_SHOW_HIDDEN_FILES_ENABLE;
	} else {
		mode = NAUTILUS_WINDOW_SHOW_HIDDEN_FILES_DISABLE;
	}

	nautilus_window_set_hidden_files_mode (window, mode);
}
開發者ID:bakatz,項目名稱:nautilus,代碼行數:17,代碼來源:nautilus-window-menus.c

示例2: gtk_toggle_tool_button_update

static void
gtk_toggle_tool_button_update (GtkActivatable *activatable,
			       GtkAction      *action,
			       const gchar    *property_name)
{
  GtkToggleToolButton *button;

  parent_activatable_iface->update (activatable, action, property_name);

  button = GTK_TOGGLE_TOOL_BUTTON (activatable);

  if (strcmp (property_name, "active") == 0)
    {
      gtk_action_block_activate (action);
      gtk_toggle_tool_button_set_active (button, gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
      gtk_action_unblock_activate (action);
    }
}
開發者ID:BYC,項目名稱:gtk,代碼行數:18,代碼來源:gtktoggletoolbutton.c

示例3: task_view_nonstandard_days_cb

static void
task_view_nonstandard_days_cb (GtkAction *action,
                               gpointer   data)
{
    PlannerTaskViewPriv *priv;
    gboolean             state;

    priv = PLANNER_TASK_VIEW (data)->priv;

    state = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));

    planner_task_tree_set_nonstandard_days (
        PLANNER_TASK_TREE (priv->tree),
        state);


    planner_conf_set_bool (NOSTDDAYS_PATH_KEY, state, NULL);
}
開發者ID:Zaba999,項目名稱:planner,代碼行數:18,代碼來源:planner-task-view.c

示例4: view_flip_vertically_cmd_callback

void
view_flip_vertically_cmd_callback (GtkAction *action,
                                   gpointer   data)
{
  GimpDisplay      *display;
  GimpDisplayShell *shell;
  gboolean          active;
  return_if_no_display (display, data);

  shell = gimp_display_get_shell (display);

  active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));

  if (active != shell->flip_vertically)
    {
      gimp_display_shell_flip (shell, shell->flip_horizontally, active);
    }
}
開發者ID:ellelstone,項目名稱:gimp,代碼行數:18,代碼來源:view-commands.c

示例5: _gedit_cmd_view_leave_fullscreen_mode

void
_gedit_cmd_view_leave_fullscreen_mode (GtkAction *action,
				       GeditWindow *window)
{
	GtkAction *view_action;

	view_action = gtk_action_group_get_action (window->priv->always_sensitive_action_group,
						   "ViewFullscreen");
	g_signal_handlers_block_by_func
		(view_action, G_CALLBACK (_gedit_cmd_view_toggle_fullscreen_mode),
		 window);
	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (view_action),
				      FALSE);
	_gedit_window_unfullscreen (window);
	g_signal_handlers_unblock_by_func
		(view_action, G_CALLBACK (_gedit_cmd_view_toggle_fullscreen_mode),
		 window);
}
開發者ID:3dfxmadscientist,項目名稱:gnome-apps,代碼行數:18,代碼來源:gedit-commands-view.c

示例6: 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

示例7: tools_toggle_visibility_cmd_callback

void
tools_toggle_visibility_cmd_callback (GtkAction *action,
                                      gpointer   data)
{
  GimpContext  *context;
  GimpToolInfo *tool_info;
  return_if_no_context (context, data);

  tool_info = gimp_context_get_tool (context);

  if (tool_info)
    {
      gboolean active =
        gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));

      if (active != tool_info->visible)
        g_object_set (tool_info, "visible", active, NULL);
    }
}
開發者ID:Amerekanets,項目名稱:gimp,代碼行數:19,代碼來源:tools-commands.c

示例8: gui_set_toolbar_visible

/** Set the visibility of the toolbar */
static void gui_set_toolbar_visible(void)
{
	GSList *list;
	gboolean visible;

	list = gtk_ui_manager_get_toplevels(ui_manager,
					    GTK_UI_MANAGER_TOOLBAR);
	g_assert(g_slist_length(list) == 1);
	visible = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION
					       (gtk_ui_manager_get_action
						(ui_manager,
						 "ui/MainMenu/SettingsMenu/ShowHideToolbar")));
	if (visible)
		gtk_widget_show(GTK_WIDGET(list->data));
	else
		gtk_widget_hide(GTK_WIDGET(list->data));
	config_set_int("settings/show_toolbar", visible);
	g_slist_free(list);
}
開發者ID:Alex-Sjoberg,項目名稱:Pioneers,代碼行數:20,代碼來源:gui.c

示例9: action_show_hidden_files_callback

static void
action_show_hidden_files_callback (GtkAction *action,
                                   gpointer callback_data)
{
    CajaWindow *window;
    CajaWindowShowHiddenFilesMode mode;

    window = CAJA_WINDOW (callback_data);

    if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)))
    {
        mode = CAJA_WINDOW_SHOW_HIDDEN_FILES_ENABLE;
    }
    else
    {
        mode = CAJA_WINDOW_SHOW_HIDDEN_FILES_DISABLE;
    }

    caja_window_info_set_hidden_files_mode (window, mode);
}
開發者ID:fatman2021,項目名稱:caja,代碼行數:20,代碼來源:caja-window-menus.c

示例10: show_view_highlight_critical_cb

static void
show_view_highlight_critical_cb (GtkAction *action,
				  gpointer   data)
{
	PlannerShowView     *view;
	PlannerShowViewPriv *priv;
	gboolean         state;

	view = PLANNER_SHOW_VIEW (data);
	priv = view->priv;

	state = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));

	planner_gantt_chart_set_highlight_critical_tasks (
		PLANNER_GANTT_CHART (priv->gantt),
		state);

	//planner_task_tree_set_highlight_critical (
                //PLANNER_TASK_TREE (priv->tree), state);
}
開發者ID:zsyyr,項目名稱:PlannerWin,代碼行數:20,代碼來源:planner-show-view.c

示例11: nemo_window_update_show_hide_menu_items

void
nemo_window_update_show_hide_menu_items (NemoWindow *window) 
{
	GtkActionGroup *action_group;
	GtkAction *action;
	guint current_value;

	action_group = nemo_window_get_main_action_group (window);

	action = gtk_action_group_get_action (action_group,
					      NEMO_ACTION_SHOW_HIDE_EXTRA_PANE);
	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
				      nemo_window_split_view_showing (window));
	nemo_window_update_split_view_actions_sensitivity (window);

	action = gtk_action_group_get_action (action_group,
					      "Sidebar Places");
	current_value = sidebar_id_to_value (window->details->sidebar_id);
	gtk_radio_action_set_current_value (GTK_RADIO_ACTION (action), current_value);
}
開發者ID:fossamikom,項目名稱:nemo,代碼行數:20,代碼來源:nemo-window-menus.c

示例12: action_show_hide_search_callback

static void
action_show_hide_search_callback (GtkAction *action,
				  gpointer user_data)
{
	NemoWindowPane *pane = user_data;
	NemoWindow *window = pane->window;

	if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))) {
		nemo_window_pane_ensure_search_bar (pane);
	} else {
		NemoWindowSlot *slot;
		GFile *location = NULL;

		slot = pane->active_slot;
		nemo_window_pane_hide_search_bar (pane);

		/* Use the location bar as the return location */
		if (slot->query_editor != NULL) {
			NemoQuery *query;
			char *uri;

			query = nemo_query_editor_get_query (slot->query_editor);
			if (query != NULL) {
				uri = nemo_query_get_location (query);
				if (uri != NULL) {
					location = g_file_new_for_uri (uri);
					g_free (uri);
				}
				g_object_unref (query);
			}

			/* Last try: use the home directory as the return location */
			if (location == NULL) {
				location = g_file_new_for_path (g_get_home_dir ());
			}

			nemo_window_go_to (window, location);
			g_object_unref (location);
		}
	}
}
開發者ID:plata,項目名稱:nemo,代碼行數:41,代碼來源:nemo-window-pane.c

示例13: view_display_bpc_cmd_callback

void
view_display_bpc_cmd_callback (GtkAction *action,
                               gpointer   data)
{
  GimpDisplayShell *shell;
  GimpColorConfig  *color_config;
  gboolean          active;
  return_if_no_shell (shell, data);

  color_config = gimp_display_shell_get_color_config (shell);

  active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));

  if (active != gimp_color_config_get_display_bpc (color_config))
    {
      g_object_set (color_config,
                    "display-use-black-point-compensation", active,
                    NULL);
      shell->color_config_set = TRUE;
    }
}
開發者ID:ellelstone,項目名稱:gimp,代碼行數:21,代碼來源:view-commands.c

示例14: search_box_toggle_highlight

void 
search_box_toggle_highlight (SearchBox * search_box, gboolean status)
{
	if (!search_box->priv->current_editor)
		return;

	search_box->priv->highlight_all = status;
	gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(search_box->priv->highlight_action),
	                             status);

	if (!status)
	{
		ianjuta_indicable_clear(IANJUTA_INDICABLE(search_box->priv->current_editor), NULL);
		g_clear_object (&search_box->priv->start_highlight);
		g_clear_object (&search_box->priv->end_highlight);
	}
	else
	{
		search_box_highlight_all (search_box);
	}
}
開發者ID:kyoushuu,項目名稱:anjuta,代碼行數:21,代碼來源:search-box.c

示例15: view_softproof_gamut_check_cmd_callback

void
view_softproof_gamut_check_cmd_callback (GtkAction *action,
                                         gpointer   data)
{
  GimpDisplayShell *shell;
  GimpColorConfig  *color_config;
  gboolean          active;
  return_if_no_shell (shell, data);

  color_config = gimp_display_shell_get_color_config (shell);

  active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));

  if (active != gimp_color_config_get_simulation_gamut_check (color_config))
    {
      g_object_set (color_config,
                    "simulation-gamut-check", active,
                    NULL);
      shell->color_config_set = TRUE;
    }
}
開發者ID:ellelstone,項目名稱:gimp,代碼行數:21,代碼來源:view-commands.c


注:本文中的GTK_TOGGLE_ACTION函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。