当前位置: 首页>>代码示例>>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;未经允许,请勿转载。