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

C++ GTK_UI_MANAGER函数代码示例

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

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



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

示例1: windows_menu_recent_add

static void
windows_menu_recent_add (GimpContainer   *container,
                         GimpSessionInfo *info,
                         GimpUIManager   *manager)
{
  const gchar *ui_path;
  gchar       *action_name;
  gchar       *action_path;
  gint         info_id;
  gchar       *merge_key;
  guint        merge_id;

  ui_path = g_object_get_data (G_OBJECT (manager), "image-menu-ui-path");

  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_path = g_strdup_printf ("%s/Windows/Recently Closed Docks", ui_path);

  merge_key = g_strdup_printf ("windows-recent-%04d-merge-id", info_id);
  merge_id = gtk_ui_manager_new_merge_id (GTK_UI_MANAGER (manager));

  g_object_set_data (G_OBJECT (manager), merge_key,
                     GUINT_TO_POINTER (merge_id));

  gtk_ui_manager_add_ui (GTK_UI_MANAGER (manager), merge_id,
                         action_path, action_name, action_name,
                         GTK_UI_MANAGER_MENUITEM,
                         TRUE);

  g_free (merge_key);
  g_free (action_path);
  g_free (action_name);
}
开发者ID:Anstep,项目名称:gimp,代码行数:35,代码来源:windows-menu.c


示例2: windows_menu_dock_window_added

static void
windows_menu_dock_window_added (GimpDialogFactory *factory,
                                GimpDockWindow    *dock_window,
                                GimpUIManager     *manager)
{
  const gchar *ui_path;
  gchar       *action_name;
  gchar       *action_path;
  gchar       *merge_key;
  guint        merge_id;

  ui_path = g_object_get_data (G_OBJECT (manager), "image-menu-ui-path");

  action_name = windows_actions_dock_window_to_action_name (dock_window);
  action_path = g_strdup_printf ("%s/Windows/Docks",
                                 ui_path);

  merge_key = windows_menu_dock_window_to_merge_id (dock_window);
  merge_id  = gtk_ui_manager_new_merge_id (GTK_UI_MANAGER (manager));

  g_object_set_data (G_OBJECT (manager), merge_key,
                     GUINT_TO_POINTER (merge_id));

  gtk_ui_manager_add_ui (GTK_UI_MANAGER (manager), merge_id,
                         action_path, action_name, action_name,
                         GTK_UI_MANAGER_MENUITEM,
                         FALSE);

  g_free (merge_key);
  g_free (action_path);
  g_free (action_name);
}
开发者ID:Anstep,项目名称:gimp,代码行数:32,代码来源:windows-menu.c


示例3: search_box_new

GtkWidget*
search_box_new (AnjutaDocman *docman)
{
	SearchBox* search_box;
	AnjutaUI *ui;

	search_box = SEARCH_BOX (g_object_new (SEARCH_TYPE_BOX, "homogeneous",
											FALSE, NULL));

	g_signal_connect (G_OBJECT (docman), "document-changed",
					  G_CALLBACK (on_document_changed), search_box);

	search_box->priv->status = anjuta_shell_get_status (docman->shell, NULL);
	
	ui = anjuta_shell_get_ui (docman->shell, NULL);
	search_box->priv->popup_menu = gtk_ui_manager_get_widget (GTK_UI_MANAGER (ui),
											"/SearchboxPopup");
	g_assert (search_box->priv->popup_menu != NULL && GTK_IS_MENU (search_box->priv->popup_menu));

	search_box->priv->case_action = 
		gtk_ui_manager_get_action (GTK_UI_MANAGER (ui),
		                           "/SearchboxPopup/CaseCheck");

	search_box->priv->highlight_action =
		gtk_ui_manager_get_action (GTK_UI_MANAGER (ui),
		                           "/SearchboxPopup/HighlightAll");
	search_box->priv->regex_action = 
		gtk_ui_manager_get_action (GTK_UI_MANAGER (ui),
		                           "/SearchboxPopup/RegexSearch");

	g_signal_connect (search_box->priv->popup_menu, "deactivate",
					  G_CALLBACK (gtk_widget_hide), NULL);

	return GTK_WIDGET (search_box);
}
开发者ID:kyoushuu,项目名称:anjuta,代码行数:35,代码来源:search-box.c


示例4: ptp_simulator_ui_manager_new

PtpSimulatorUIManager *
ptp_simulator_ui_manager_new(void)
{
    PtpSimulatorUIManager   *ui_manager;
    GtkActionGroup          *menubar_action_group;
    GError                  *error = NULL;
    
    menubar_action_group = gtk_action_group_new("MenuActionGroup");
    
    gtk_action_group_add_actions(menubar_action_group,                  /* the action group */
                                 menubar_action_entries,                /* an array of action descriptions */
                                 G_N_ELEMENTS(menubar_action_entries),  /* the number of entries */
                                 NULL);                                 /* data to pass to the action callbacks */
    
    ui_manager = g_object_new(PTP_SIMULATOR_TYPE_UI_MANAGER, NULL);
    gtk_ui_manager_insert_action_group(GTK_UI_MANAGER(ui_manager), menubar_action_group, 0);
    
    gtk_ui_manager_add_ui_from_string(GTK_UI_MANAGER(ui_manager), menubar_definition, -1, &error);
    if (error != NULL) {
        fprintf(stderr, "Warning: building menubar failed: %s\n", error->message);
        g_error_free(error);
        error = NULL;
    }
    g_object_unref(menubar_action_group);
    
    return ui_manager;
}
开发者ID:te-bachi,项目名称:ptp2-simulator,代码行数:27,代码来源:ptp-simulator-ui-manager.c


示例5: on_status_view_button_press_event

static gboolean
on_status_view_button_press_event (GtkWidget *widget, GdkEvent *event,
                                   GitStatusPane *self)
{
	GdkEventButton *button_event;
	AnjutaPlugin *plugin;
	AnjutaUI *ui;
	GtkTreeView *status_view;
	GtkTreeSelection *selection;
	GtkTreeModel *status_model;
	GtkTreeIter iter;
	StatusType status_type;
	GtkMenu *menu;

	button_event = (GdkEventButton *) event;
	menu = NULL;
	
	if (button_event->type == GDK_BUTTON_PRESS && button_event->button == 3)
	{
		plugin = anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE (self));
		ui = anjuta_shell_get_ui (plugin->shell, NULL);
		status_view = GTK_TREE_VIEW (gtk_builder_get_object (self->priv->builder,
		                                                     "status_view"));
		selection = gtk_tree_view_get_selection (status_view);

		if (gtk_tree_selection_get_selected (selection, &status_model, &iter))
		{
			gtk_tree_model_get (status_model, &iter, COL_TYPE, &status_type, 
			                    -1);

			if (status_type == STATUS_TYPE_COMMIT)
			{
				menu = GTK_MENU (gtk_ui_manager_get_widget (GTK_UI_MANAGER (ui),
				                              			    "/GitStatusCommitPopup"));
			}
			else if (status_type == STATUS_TYPE_NOT_UPDATED)
			{
				menu = GTK_MENU (gtk_ui_manager_get_widget (GTK_UI_MANAGER (ui),
				                              				"/GitStatusNotUpdatedPopup"));
			}

			if (menu)
			{
				gtk_menu_popup (menu, NULL, NULL, NULL, NULL, button_event->button, 
				                button_event->time);
			}
		}
	}

	return FALSE;
}
开发者ID:kyoushuu,项目名称:anjuta,代码行数:51,代码来源:git-status-pane.c


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


示例7: galeon_encoding_menu_set_window

static void
galeon_encoding_menu_set_window (GaleonEncodingMenu *menu, GaleonWindow *window)
{
	GtkActionGroup *action_group;
	GtkWidget *widget;
	GList *encodings;

	g_return_if_fail (GALEON_IS_WINDOW (window));

	menu->priv->window = window;
	menu->priv->merge  = GTK_UI_MANAGER (window->merge);

	action_group = gtk_action_group_new ("EncodingActions");
	gtk_action_group_set_translation_domain (action_group, NULL);
	menu->priv->action_group = action_group;

	gtk_action_group_add_actions (action_group, menu_entries,
				      n_menu_entries, menu);
	gtk_action_group_add_toggle_actions (action_group, toggle_menu_entries,
                                    	     n_toggle_menu_entries, menu);

	encodings = galeon_encodings_get_encodings (menu->priv->encodings, LG_ALL);
	g_list_foreach (encodings, (GFunc) add_action, menu);
	g_list_free (encodings);

	gtk_ui_manager_insert_action_group (menu->priv->merge,
					    action_group, 0);
	g_object_unref (action_group);

	widget = gtk_ui_manager_get_widget (menu->priv->merge,
					    "/menubar/View");
	g_signal_connect_object (widget, "activate",
				 G_CALLBACK (update_encoding_menu_cb),
				 menu, 0);
}
开发者ID:GNOME,项目名称:galeon,代码行数:35,代码来源:galeon-encoding-menu.c


示例8: clip_GTK_UIMANAGERADDUI

int
clip_GTK_UIMANAGERADDUI(ClipMachine * ClipMachineMemory)
{
   C_object *cmanager = _fetch_co_arg(ClipMachineMemory);

   guint     merge_id = _clip_parni(ClipMachineMemory, 2);

   gchar    *path = _clip_parc(ClipMachineMemory, 3);

   gchar    *name = _clip_parc(ClipMachineMemory, 4);

   gchar    *action = _clip_parc(ClipMachineMemory, 5);

   GtkUIManagerItemType type = _clip_parni(ClipMachineMemory, 6);

   gboolean  top = _clip_parl(ClipMachineMemory, 7);

   CHECKARG2(1, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
   CHECKCOBJ(cmanager, GTK_IS_UI_MANAGER(cmanager->object));
   CHECKARG(2, NUMERIC_type_of_ClipVarType);
   CHECKARG(3, CHARACTER_type_of_ClipVarType);
   CHECKARG(4, CHARACTER_type_of_ClipVarType);
   CHECKARG(5, CHARACTER_type_of_ClipVarType);
   CHECKARG(6, NUMERIC_type_of_ClipVarType);
   CHECKARG(7, LOGICAL_type_of_ClipVarType);

   gtk_ui_manager_add_ui(GTK_UI_MANAGER(cmanager->object), merge_id, path, name, action, type, top);

   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:32,代码来源:uimanager.c


示例9: clip_GTK_UIMANAGERGETACTION

int
clip_GTK_UIMANAGERGETACTION(ClipMachine * ClipMachineMemory)
{
   C_object *cmanager = _fetch_co_arg(ClipMachineMemory);

   gchar    *path = _clip_parc(ClipMachineMemory, 2);

   GtkAction *action;

   C_object *caction;

   CHECKARG2(1, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
   CHECKCOBJ(cmanager, GTK_IS_UI_MANAGER(cmanager->object));
   CHECKARG(2, CHARACTER_type_of_ClipVarType);

   action = gtk_ui_manager_get_action(GTK_UI_MANAGER(cmanager->object), path);

   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);
    }
   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:29,代码来源:uimanager.c


示例10: build_search_entry

static void
build_search_entry(GitgWindow *window, GtkBuilder *builder)
{
	GtkWidget *box = GTK_WIDGET(gtk_builder_get_object(builder, "hbox_top"));
	GtkWidget *entry = sexy_icon_entry_new();
	
	GtkImage *image = GTK_IMAGE(gtk_image_new_from_stock(GTK_STOCK_FIND, GTK_ICON_SIZE_MENU));
	sexy_icon_entry_set_icon(SEXY_ICON_ENTRY(entry), SEXY_ICON_ENTRY_PRIMARY, image);
	
	gtk_tree_view_set_search_entry(window->priv->tree_view, GTK_ENTRY(entry));
	gtk_widget_show(entry);
	gtk_box_pack_end(GTK_BOX(box), entry, FALSE, FALSE, 0);
	
	GtkBuilder *b = gitg_utils_new_builder( "gitg-menus.xml");
	
	GtkUIManager *manager = GTK_UI_MANAGER(gtk_builder_get_object(b, "uiman"));
	window->priv->search_popup = GTK_WIDGET(g_object_ref(gtk_ui_manager_get_widget(manager, "/ui/search_popup")));
	
	gtk_builder_connect_signals(b, window);
	g_object_unref(b);
	
	g_signal_connect(entry, "icon-pressed", G_CALLBACK(on_search_icon_pressed), window);
	gtk_tree_view_set_search_column(window->priv->tree_view, 1);
	
	gtk_tree_view_set_search_equal_func(window->priv->tree_view, search_equal_func, window, NULL);
	
	GtkAccelGroup *group = gtk_accel_group_new();
	
	GClosure *closure = g_cclosure_new(G_CALLBACK(focus_search), entry, NULL); 
	gtk_accel_group_connect(group, GDK_f, GDK_CONTROL_MASK, 0, closure); 
	gtk_window_add_accel_group(GTK_WINDOW(window), group);
}
开发者ID:mpe,项目名称:gitg,代码行数:32,代码来源:gitg-window.c


示例11: clip_GTK_UIMANAGERGETACCELGROUP

int
clip_GTK_UIMANAGERGETACCELGROUP(ClipMachine * ClipMachineMemory)
{
   C_object *cmanager = _fetch_co_arg(ClipMachineMemory);

   GtkAccelGroup *agroup;

   C_widget *cagroup;

   CHECKARG2(1, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
   CHECKCOBJ(cmanager, GTK_IS_UI_MANAGER(cmanager->object));

   agroup = gtk_ui_manager_get_accel_group(GTK_UI_MANAGER(cmanager->object));

   if (agroup)
    {
       cagroup = _list_get_cwidget(ClipMachineMemory, agroup);
       if (!cagroup)
	  cagroup = _register_widget(ClipMachineMemory, GTK_WIDGET(agroup), NULL);
       if (cagroup)
	  _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &cagroup->obj);
    }
   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:26,代码来源:uimanager.c


示例12: on_log_view_button_press_event

static gboolean
on_log_view_button_press_event (GtkWidget *log_view, GdkEventButton *event,
                                GitLogPane *self)
{
	GtkMenu *menu;
	GtkTreeSelection *selection;
	AnjutaPlugin *plugin;
	AnjutaUI *ui;

	if (event->type == GDK_BUTTON_PRESS && event->button == 3)
	{
		selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (log_view));

		if (gtk_tree_selection_count_selected_rows (selection) > 0)
		{
			plugin = anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE (self));
			ui = anjuta_shell_get_ui (plugin->shell, NULL);

			menu = GTK_MENU (gtk_ui_manager_get_widget (GTK_UI_MANAGER (ui),
			                                            "/GitLogPopup"));

			gtk_menu_popup (menu, NULL, NULL, NULL, NULL, event->button, 
			                event->time);
		}
	}

	return FALSE;
}
开发者ID:VujinovM,项目名称:anjuta,代码行数:28,代码来源:git-log-pane.c


示例13: file_menu_setup

void
file_menu_setup (GimpUIManager *manager,
                 const gchar   *ui_path)
{
  GtkUIManager *ui_manager;
  gint          n_entries;
  guint         merge_id;
  gint          i;

  g_return_if_fail (GIMP_IS_UI_MANAGER (manager));
  g_return_if_fail (ui_path != NULL);

  ui_manager = GTK_UI_MANAGER (manager);

  n_entries = GIMP_GUI_CONFIG (manager->gimp->config)->last_opened_size;

  merge_id = gtk_ui_manager_new_merge_id (ui_manager);

  for (i = 0; i < n_entries; i++)
    {
      gchar *action_name;
      gchar *action_path;

      action_name = g_strdup_printf ("file-open-recent-%02d", i + 1);
      action_path = g_strdup_printf ("%s/File/Open Recent/Files", ui_path);

      gtk_ui_manager_add_ui (ui_manager, merge_id,
                             action_path, action_name, action_name,
                             GTK_UI_MANAGER_MENUITEM,
                             FALSE);

      g_free (action_name);
      g_free (action_path);
    }
}
开发者ID:Amerekanets,项目名称:gimp,代码行数:35,代码来源:file-menu.c


示例14: impl_attach_window

static void
impl_attach_window (EphyExtension *ext,
		    EphyWindow *window)
{
	LOG ("EphyJavaConsoleExtension attach_window");

	if (java_console_is_available ())
	{
		GtkUIManager *manager;
		WindowData *data;

		data = g_new0 (WindowData, 1);

		g_object_set_data_full (G_OBJECT (window), WINDOW_DATA_KEY, data,
					(GDestroyNotify) g_free);

		data->action_group = gtk_action_group_new ("EphyJCExtActions");
		gtk_action_group_set_translation_domain (data->action_group, GETTEXT_PACKAGE);
		gtk_action_group_add_actions (data->action_group, action_entries,
				      	      G_N_ELEMENTS (action_entries), window);

		manager = GTK_UI_MANAGER (ephy_window_get_ui_manager (window));
		gtk_ui_manager_insert_action_group (manager, data->action_group, 0);
		g_object_unref (data->action_group);

		data->merge_id = gtk_ui_manager_new_merge_id (manager);

		gtk_ui_manager_add_ui (manager, data->merge_id, "/menubar/ToolsMenu",
				       ACTION_NAME_SHOW_CONSOLE, ACTION_NAME_SHOW_CONSOLE,
				       GTK_UI_MANAGER_MENUITEM, FALSE);
	}
}
开发者ID:GNOME,项目名称:epiphany-extensions,代码行数:32,代码来源:ephy-java-console-extension.c


示例15: gimp_ui_manager_entry_load

static gboolean
gimp_ui_manager_entry_load (GimpUIManager         *manager,
                            GimpUIManagerUIEntry  *entry,
                            GError               **error)
{
  gchar       *filename           = NULL;
  const gchar *menus_dir_override = g_getenv ("GIMP_TESTING_MENUS_DIR");

  /* In order for test cases to be able to run without GIMP being
   * installed yet, allow them to override the menus directory to the
   * menus dir in the source root
   */
  if (menus_dir_override)
    filename = g_build_filename (menus_dir_override, entry->basename, NULL);
  else
    filename = g_build_filename (gimp_data_directory (), "menus",
                                 entry->basename, NULL);

  if (manager->gimp->be_verbose)
    g_print ("loading menu '%s' for %s\n",
             gimp_filename_to_utf8 (filename), entry->ui_path);

  entry->merge_id = gtk_ui_manager_add_ui_from_file (GTK_UI_MANAGER (manager),
                                                     filename, error);

  g_free (filename);

  if (! entry->merge_id)
    return FALSE;

  return TRUE;
}
开发者ID:AnonPower,项目名称:picman,代码行数:32,代码来源:gimpuimanager.c


示例16: windows_menu_display_reorder

static void
windows_menu_display_reorder (GimpContainer *container,
                              GimpDisplay   *display,
                              gint           new_index,
                              GimpUIManager *manager)
{
  gint n_display = gimp_container_get_n_children (container);
  gint i;

  for (i = new_index; i < n_display; i++)
    {
      GimpObject *d = gimp_container_get_child_by_index (container, i);

      windows_menu_display_remove (container, GIMP_DISPLAY (d), manager);
    }

  /* If I don't ensure the menu items are effectively removed, adding
   * the same ones may simply cancel the effect of the removal, hence
   * losing the menu reordering.
   */
  gtk_ui_manager_ensure_update (GTK_UI_MANAGER (manager));

  for (i = new_index; i < n_display; i++)
    {
      GimpObject *d = gimp_container_get_child_by_index (container, i);

      windows_menu_display_add (container, GIMP_DISPLAY (d), manager);
    }
}
开发者ID:Anstep,项目名称:gimp,代码行数:29,代码来源:windows-menu.c


示例17: actions_changed_cb

gboolean
actions_changed_cb(GSignalInvocationHint *hint,
                   guint n_param_values,
                   const GValue *param_values,
                   gpointer data)
{
    ParasiteActionList *actionlist = PARASITE_ACTIONLIST(data);
    GtkUIManager *uimanager;
    GSList *i;

    uimanager = GTK_UI_MANAGER(g_value_get_object(&param_values[0]));

    i = g_slist_find(actionlist->priv->uimanagers, uimanager);
    if (i == NULL) {
        actionlist->priv->uimanagers =
            g_slist_prepend(actionlist->priv->uimanagers, uimanager);
        g_object_weak_ref(G_OBJECT(uimanager), uimanager_dispose_cb, data);
    }

    if (actionlist->priv->update_timeout == 0) {
        actionlist->priv->update_timeout =
            g_timeout_add(20, (GSourceFunc) update, actionlist);
    }

    return TRUE;
}
开发者ID:bebarino,项目名称:gtkparasite,代码行数:26,代码来源:action-list.c


示例18: clip_GTK_UIMANAGERGETWIDGET

int
clip_GTK_UIMANAGERGETWIDGET(ClipMachine * ClipMachineMemory)
{
   C_object *cmanager = _fetch_co_arg(ClipMachineMemory);

   gchar    *path = _clip_parc(ClipMachineMemory, 2);

   GtkWidget *wid;

   C_widget *cwid;

   CHECKARG2(1, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
   CHECKCOBJ(cmanager, GTK_IS_UI_MANAGER(cmanager->object));
   CHECKARG(2, CHARACTER_type_of_ClipVarType);

   wid = gtk_ui_manager_get_widget(GTK_UI_MANAGER(cmanager->object), path);

   if (wid)
    {
       cwid = _list_get_cwidget(ClipMachineMemory, wid);
       if (!cwid)
	  cwid = _register_widget(ClipMachineMemory, wid, NULL);
       if (cwid)
	  _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &cwid->obj);
    }
   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:29,代码来源:uimanager.c


示例19: on_file_view_show_popup_menu

static void
on_file_view_show_popup_menu (AnjutaFileView* view, GFile* file,
							  gboolean is_dir, guint button,
							  guint32 time, AnjutaFileManager* file_manager)
{
	GtkWidget *popup;
	GtkWidget *rename;
	AnjutaUI* ui = anjuta_shell_get_ui (ANJUTA_PLUGIN(file_manager)->shell, 
										NULL);
	popup = gtk_ui_manager_get_widget (GTK_UI_MANAGER (ui),
									   "/PopupFileManager");
	rename = gtk_ui_manager_get_widget (GTK_UI_MANAGER (ui),
									   "/PopupFileManager/PopupFileManagerRename");
	/* TODO */
	gtk_widget_hide (rename);
	
	g_return_if_fail (GTK_IS_WIDGET (popup));
	gtk_menu_popup (GTK_MENU (popup), NULL, NULL, NULL, NULL, button, time);
}
开发者ID:rosedu,项目名称:anjuta,代码行数:19,代码来源:plugin.c


示例20: gimp_color_panel_button_press

static gboolean
gimp_color_panel_button_press (GtkWidget      *widget,
                               GdkEventButton *bevent)
{
  if (gdk_event_triggers_context_menu ((GdkEvent *) bevent))
    {
      GimpColorButton *color_button;
      GimpColorPanel  *color_panel;
      GtkUIManager    *ui_manager;
      GtkActionGroup  *group;
      GtkAction       *action;
      GimpRGB          color;

      color_button = GIMP_COLOR_BUTTON (widget);
      color_panel  = GIMP_COLOR_PANEL (widget);
      ui_manager   = GTK_UI_MANAGER (color_button->popup_menu);

      group = gtk_ui_manager_get_action_groups (ui_manager)->data;

      action = gtk_action_group_get_action (group,
                                            "color-button-use-foreground");
      gtk_action_set_visible (action, color_panel->context != NULL);

      action = gtk_action_group_get_action (group,
                                            "color-button-use-background");
      gtk_action_set_visible (action, color_panel->context != NULL);

      if (color_panel->context)
        {
          action = gtk_action_group_get_action (group,
                                                "color-button-use-foreground");
          gimp_context_get_foreground (color_panel->context, &color);
          g_object_set (action, "color", &color, NULL);

          action = gtk_action_group_get_action (group,
                                                "color-button-use-background");
          gimp_context_get_background (color_panel->context, &color);
          g_object_set (action, "color", &color, NULL);
        }

      action = gtk_action_group_get_action (group, "color-button-use-black");
      gimp_rgba_set (&color, 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE);
      g_object_set (action, "color", &color, NULL);

      action = gtk_action_group_get_action (group, "color-button-use-white");
      gimp_rgba_set (&color, 1.0, 1.0, 1.0, GIMP_OPACITY_OPAQUE);
      g_object_set (action, "color", &color, NULL);
    }

  if (GTK_WIDGET_CLASS (parent_class)->button_press_event)
    return GTK_WIDGET_CLASS (parent_class)->button_press_event (widget, bevent);

  return FALSE;
}
开发者ID:AdamGrzonkowski,项目名称:gimp-1,代码行数:54,代码来源:gimpcolorpanel.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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