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

C++ GTK_TOOLBAR函数代码示例

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

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



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

示例1: ZLApplicationWindow

ZLGtkApplicationWindow::ZLGtkApplicationWindow(ZLApplication *application) :
	ZLApplicationWindow(application),
	KeyActionOnReleaseNotOnPressOption(ZLCategoryKey::CONFIG, "KeyAction", "OnRelease", false),
	myFullScreen(false) {
	myProgram = HILDON_PROGRAM(hildon_program_get_instance());
	g_set_application_name("");

	myWindow = HILDON_WINDOW(hildon_window_new());

	((ZLMaemoCommunicationManager&)ZLCommunicationManager::Instance()).init();

	myToolbar = GTK_TOOLBAR(gtk_toolbar_new());
	gtk_toolbar_set_show_arrow(myToolbar, false);
	gtk_toolbar_set_orientation(myToolbar, GTK_ORIENTATION_HORIZONTAL);
	gtk_toolbar_set_style(myToolbar, GTK_TOOLBAR_ICONS);

	myMenu = GTK_MENU(gtk_menu_new());
	hildon_window_set_menu(myWindow, myMenu);
	gtk_widget_show_all(GTK_WIDGET(myMenu));

	hildon_window_add_toolbar(myWindow, myToolbar);
	hildon_program_add_window(myProgram, myWindow);
	gtk_widget_show_all(GTK_WIDGET(myWindow));

	myViewWidget = 0;

	ZLGtkSignalUtil::connectSignal(GTK_OBJECT(myWindow), "delete_event", GTK_SIGNAL_FUNC(applicationQuit), this);
	ZLGtkSignalUtil::connectSignal(GTK_OBJECT(myWindow), "key_press_event", GTK_SIGNAL_FUNC(handleKeyPress), this);
	ZLGtkSignalUtil::connectSignal(GTK_OBJECT(myWindow), "key_release_event", GTK_SIGNAL_FUNC(handleKeyRelease), this);
}
开发者ID:euroelessar,项目名称:FBReader,代码行数:30,代码来源:ZLGtkApplicationWindow.cpp


示例2: plugin_add_toolbar_item

/** Inserts a toolbar item before the Quit button, or after the previous plugin toolbar item.
 * A separator is added on the first call to this function, and will be shown when @a item is
 * shown; hidden when @a item is hidden.
 * @note You should still destroy @a item yourself, usually in @ref plugin_cleanup().
 * @param plugin Must be @ref geany_plugin.
 * @param item The item to add. */
void plugin_add_toolbar_item(GeanyPlugin *plugin, GtkToolItem *item)
{
	GtkToolbar *toolbar = GTK_TOOLBAR(main_widgets.toolbar);
	gint pos;
	GeanyAutoSeparator *autosep;

	g_return_if_fail(plugin);
	autosep = &plugin->priv->toolbar_separator;

	if (!autosep->widget)
	{
		GtkToolItem *sep;

		pos = toolbar_get_insert_position();

		sep = gtk_separator_tool_item_new();
		gtk_toolbar_insert(toolbar, sep, pos);
		autosep->widget = GTK_WIDGET(sep);

		toolbar_item_ref(sep);
	}
	else
	{
		pos = gtk_toolbar_get_item_index(toolbar, GTK_TOOL_ITEM(autosep->widget));
		g_return_if_fail(pos >= 0);
	}

	gtk_toolbar_insert(toolbar, item, pos + autosep->item_count + 1);
	toolbar_item_ref(item);

	/* hide the separator widget if there are no toolbar items showing for the plugin */
	ui_auto_separator_add_ref(autosep, GTK_WIDGET(item));
}
开发者ID:AR-H,项目名称:geany,代码行数:39,代码来源:pluginutils.c


示例3: gboolean

GtkWidget *tool_button(GtkWidget *bar, GdkDrawable *drawable,
    char **xpm, const char *tooltip,
    gboolean (*cb)(GtkWidget *widget, GdkEventButton *event, gpointer data),
    gpointer data)
{
	GtkWidget *image, *evbox;
	GtkToolItem *item;

	/*
	 * gtk_radio_tool_button_new_from_widget is *huge*. We try to do things
	 * in a
	 * more compact way.
	 */

	evbox = gtk_event_box_new();
	if (xpm) {
		image = make_image(drawable, xpm, tooltip);
		gtk_container_add(GTK_CONTAINER(evbox), image);
	}
	g_signal_connect(G_OBJECT(evbox), "button_press_event",
            G_CALLBACK(cb), data);

	item = gtk_tool_item_new();
	gtk_container_add(GTK_CONTAINER(item), evbox);

	gtk_container_set_border_width(GTK_CONTAINER(item), 0);

	gtk_toolbar_insert(GTK_TOOLBAR(bar), item, -1);

	return evbox;
}
开发者ID:bert,项目名称:fped,代码行数:31,代码来源:gui_util.c


示例4: ui_common_toolbar_append_separator

void ui_common_toolbar_append_separator(GtkWidget * toolbar) {
  GtkToolItem * toolbar_item;
  toolbar_item =  gtk_separator_tool_item_new();
  gtk_tool_item_set_homogeneous(toolbar_item, FALSE);
  gtk_toolbar_insert(GTK_TOOLBAR(toolbar), toolbar_item, -1);
  return;
}
开发者ID:neuroradiology,项目名称:amide,代码行数:7,代码来源:ui_common.c


示例5: tm_populate

static void
tm_populate(GtkWidget * toolbar, BalsaToolbarModel * model)
{
    gboolean style_is_both;
    gboolean make_two_line;
    GArray *current;
    guint j;
    GActionMap *action_map =
        g_object_get_data(G_OBJECT(toolbar), BALSA_TOOLBAR_ACTION_MAP);

    style_is_both = (model->style == GTK_TOOLBAR_BOTH
                     || (model->style == (GtkToolbarStyle) - 1
                         && tm_default_style() == GTK_TOOLBAR_BOTH));
    make_two_line = style_is_both && tm_has_second_line(model);

    current = balsa_toolbar_model_get_current(model);
    for (j = 0; j < current->len; j++) {
        BalsaToolbarEntry *entry;
        GtkToolItem *item;

        entry = &g_array_index(current, BalsaToolbarEntry, j);

        if (!*entry->action) {
            item = gtk_separator_tool_item_new();
        } else {
            GtkWidget *icon;
            GAction *action;
            const GVariantType *type;
            gchar *prefixed_action;

            icon = gtk_image_new_from_icon_name
                (balsa_icon_id(entry->icon), GTK_ICON_SIZE_SMALL_TOOLBAR);
            action = g_action_map_lookup_action(action_map, entry->action);
            if (action &&
                (type = g_action_get_state_type(action)) &&
                g_variant_type_equal(type, G_VARIANT_TYPE_BOOLEAN)) {
                item = gtk_toggle_tool_button_new();
                g_object_set(G_OBJECT(item), "icon-widget", icon,
                             "label", entry->action, NULL);
            } else {
                item = gtk_tool_button_new(icon, entry->action);
            }
            tm_set_tool_item_label(GTK_TOOL_ITEM(item), entry->icon,
                                   make_two_line);

            prefixed_action =
                g_strconcat(action ? "win." : "app.", entry->action, NULL);
            gtk_actionable_set_action_name(GTK_ACTIONABLE(item),
                                           prefixed_action);
            g_free(prefixed_action);
        }
        gtk_toolbar_insert((GtkToolbar *) toolbar, item, -1);
    }

    gtk_toolbar_set_style(GTK_TOOLBAR(toolbar),
                          model->style != (GtkToolbarStyle) (-1) ?
                          model->style : tm_default_style());

    gtk_widget_show_all(toolbar);
}
开发者ID:GNOME,项目名称:balsa,代码行数:60,代码来源:toolbar-factory.c


示例6: g_object_new

GtkWidget *XttMethodToolbarGtk::build()
{
  pwr_tFileName fname;

  // Toolbar
  m_toolbar_w = (GtkWidget *) g_object_new(GTK_TYPE_TOOLBAR, NULL);

  for ( int i = 0; i < m_size; i++) {
    if ( m_method_mask & (1 << i)) {
      char tooltip[200];

      strcpy( tooltip, m_data[i].tooltip);
      strcat( tooltip, m_tooltip_suffix);

      m_button_w[i] = gtk_button_new();
      dcli_translate_filename( fname, m_data[i].image);
      gtk_container_add( GTK_CONTAINER(m_button_w[i]), 
			 gtk_image_new_from_file( fname));
      g_signal_connect( m_button_w[i], "clicked", G_CALLBACK(activate_button), &m_cb[i]);
      g_object_set( m_button_w[i], "can-focus", FALSE, NULL);
      gtk_toolbar_append_widget( GTK_TOOLBAR(m_toolbar_w), m_button_w[i], CoWowGtk::translate_utf8( tooltip), "");
    }
  }
  return m_toolbar_w;
}
开发者ID:Strongc,项目名称:proview,代码行数:25,代码来源:xtt_methodtoolbar_gtk.cpp


示例7: XOJ_INIT_TYPE

SidebarToolbar::SidebarToolbar(Control* control)
{
	XOJ_INIT_TYPE(SidebarToolbar);

	this->control = control;
	this->toolbar = GTK_TOOLBAR(gtk_toolbar_new());

	gtk_toolbar_set_icon_size(this->toolbar, GTK_ICON_SIZE_SMALL_TOOLBAR);

	g_object_ref(this->toolbar);

	this->btUp = gtk_tool_button_new_from_stock(GTK_STOCK_GO_UP);
	gtk_toolbar_insert(this->toolbar, this->btUp, -1);
	g_signal_connect(this->btUp, "clicked", G_CALLBACK(&btUpClicked), this);

	this->btDown = gtk_tool_button_new_from_stock(GTK_STOCK_GO_DOWN);
	gtk_toolbar_insert(this->toolbar, this->btDown, -1);
	g_signal_connect(this->btDown, "clicked", G_CALLBACK(&btDownClicked), this);

	this->btCopy = gtk_tool_button_new_from_stock(GTK_STOCK_COPY);
	gtk_toolbar_insert(this->toolbar, this->btCopy, -1);
	g_signal_connect(this->btCopy, "clicked", G_CALLBACK(&btCopyClicked), this);

	this->btDelete = gtk_tool_button_new_from_stock(GTK_STOCK_DELETE);
	gtk_toolbar_insert(this->toolbar, this->btDelete, -1);
	g_signal_connect(this->btDelete, "clicked", G_CALLBACK(&btDeleteClicked), this);

	gtk_widget_show_all(GTK_WIDGET(this->toolbar));
}
开发者ID:project-renard-survey,项目名称:xournalpp,代码行数:29,代码来源:SidebarToolbar.cpp


示例8: set_app_drawing_toolbar_style

/*---------------------------------------------------------------------------*/
static void
set_app_drawing_toolbar_style (GtkUIManager *ui)
{
	GtkWidget *toolbar;

	gl_debug (DEBUG_UI, "START");

	g_return_if_fail (ui && GTK_IS_UI_MANAGER (ui));
			
	/* Updated view menu */
	gl_ui_util_set_verb_state (ui, "/ui/MenuBar/ViewMenu/ViewDrawingToolBar",
				   gl_prefs_model_get_drawing_toolbar_visible (gl_prefs));

	toolbar = gtk_ui_manager_get_widget (ui, "/DrawingToolBar");

	gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS);

	if (gl_prefs_model_get_drawing_toolbar_visible (gl_prefs)) {
		gtk_widget_show_all (toolbar);
	} else {
		gtk_widget_hide (toolbar);
	}
	
	gl_debug (DEBUG_UI, "END");
}
开发者ID:samlown,项目名称:glabels,代码行数:26,代码来源:ui.c


示例9: change_orientation

static void
change_orientation (GtkWidget *button, GtkWidget *toolbar)
{
  GtkWidget *table;
  GtkOrientation orientation;

  table = gtk_widget_get_parent (toolbar);
  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
    orientation = GTK_ORIENTATION_VERTICAL;
  else
    orientation = GTK_ORIENTATION_HORIZONTAL;

  g_object_ref (toolbar);
  gtk_container_remove (GTK_CONTAINER (table), toolbar);
  gtk_toolbar_set_orientation (GTK_TOOLBAR (toolbar), orientation);
  if (orientation == GTK_ORIENTATION_HORIZONTAL)
    {
      gtk_table_attach (GTK_TABLE (table), toolbar,
			0,2, 0,1, GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
    }
  else
    {
      gtk_table_attach (GTK_TABLE (table), toolbar,
			0,1, 0,4, GTK_FILL, GTK_FILL|GTK_EXPAND, 0, 0);
    }
  g_object_unref (toolbar);
}
开发者ID:Aridna,项目名称:gtk2,代码行数:27,代码来源:testtoolbar.c


示例10: c_main_window_get_toolbar

GtkToolbar*
c_main_window_get_toolbar (CMainWindow * self)
{
  g_return_val_if_fail (C_IS_MAIN_WINDOW (self), NULL);

  return GTK_TOOLBAR (gtk_ui_manager_get_widget (main_window_get_ui_manager (self), "/ui/toolbar"));
}
开发者ID:herzi,项目名称:classify,代码行数:7,代码来源:main-window.c


示例11: create_find_toolbar

/* 
 * Create the find toolbar
*/
void create_find_toolbar(AppData * view)
{
#ifdef MAEMO4
    view->find_toolbar = HILDON_FIND_TOOLBAR
        (hildon_find_toolbar_new("Find String: "));

    /* Add signal listers to "Search" and "Close" buttons */
    g_signal_connect(G_OBJECT(view->find_toolbar), "search",
                     G_CALLBACK(find_tb_search), view);
    g_signal_connect(G_OBJECT(view->find_toolbar), "close",
                     G_CALLBACK(find_tb_close), view);
    hildon_window_add_toolbar(view->window, GTK_TOOLBAR(view->find_toolbar));

    /* Set variables to AppData */
    view->find_visible = FALSE;
#else
    view->find_toolbar = gtk_toolbar_new();
    view->entry = GTK_ENTRY(gtk_entry_new ());
  
    g_signal_connect(GTK_WIDGET(view->entry), "key-press-event",
                   G_CALLBACK(on_insert_text), (gpointer)view);

    gtk_widget_show ( GTK_WIDGET(view->entry) );
#endif

}
开发者ID:FauxFaux,项目名称:despotify,代码行数:29,代码来源:maemify.c


示例12: main

int
main (int argc, char *argv[])
{
	GtkWidget *window;
	GtkToolbar *toolbar;
	GtkToolItem *item;

	gtk_init (&argc, &argv);

	window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	g_signal_connect (window, "delete-event", G_CALLBACK (on_window_delete), NULL);

	toolbar = GTK_TOOLBAR (gtk_toolbar_new ());
	gtk_toolbar_set_style (toolbar, GTK_TOOLBAR_TEXT);
	item = gtk_tool_button_new (NULL, "Prompt");
	g_signal_connect (item, "clicked", G_CALLBACK (on_prompt_clicked), window);
	gtk_toolbar_insert (toolbar, item, 0);
	gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (toolbar));

	gtk_window_set_default_size (GTK_WINDOW (window), 400, 80);
	gtk_widget_show_all (window);

	gtk_main ();

	return 0;
}
开发者ID:SuspiciouSx,项目名称:gcr,代码行数:26,代码来源:frob-system-prompt.c


示例13: set_edit_mode

static void
set_edit_mode (EggEditableToolbar *etoolbar,
	       gboolean mode)
{
  EggEditableToolbarPrivate *priv = etoolbar->priv;
  int i, l, n_items;

  i = priv->edit_mode;
  if (mode)
    {
      priv->edit_mode++;
    }
  else
    {
      g_return_if_fail (priv->edit_mode > 0);
      priv->edit_mode--;
    }
  i *= priv->edit_mode;

  if (i == 0)
    {
      for (i = get_n_toolbars (etoolbar)-1; i >= 0; i--)
        {
          GtkWidget *toolbar;

          toolbar = get_toolbar_nth (etoolbar, i);
          n_items = gtk_toolbar_get_n_items (GTK_TOOLBAR (toolbar));

          if (n_items == 0 && priv->edit_mode == 0)
            {
              egg_toolbars_model_remove_toolbar (priv->model, i);
            }
          else
            {
              for (l = 0; l < n_items; l++)
                {
                  GtkToolItem *item;

                  item = gtk_toolbar_get_nth_item (GTK_TOOLBAR (toolbar), l);

                  configure_item_cursor (item, etoolbar);
                  configure_item_sensitivity (item, etoolbar);
                }
            }
        }
    }
}
开发者ID:steev,项目名称:mate-image-viewer,代码行数:47,代码来源:egg-editable-toolbar.c


示例14: gb_gnome_app_setup_initial_app

static void
gb_gnome_app_setup_initial_app (GtkWidget *widget)
{
  GtkWidget *placeholder, *toolbar;

  /* We create a standard menubar and toolbar which the user can edit or
     simply delete anything they don't want. */
  glade_gnome_setup_initial_menus (widget);

  /* We need to get rid of the accelerators, since they aren't used, and
     they would override our default accelerators. */
  gtk_window_remove_accel_group (GTK_WINDOW (widget),
				 GNOME_APP (widget)->accel_group);

  /* FIXME: GnomeLibs bug workaround. It sets the initial border width
     to -2, which causes us lots of problems. */
#if 0
  gtk_container_set_border_width (GTK_CONTAINER (GNOME_APP (widget)->menubar),
				  0);
#endif
  gb_widget_create_from (GNOME_APP (widget)->menubar, "GtkMenubar");
  gb_widget_create_from (GNOME_APP (widget)->menubar->parent, "BonoboDockItem");

  /* Toolbar */
  toolbar = gtk_toolbar_new ();
  gnome_app_set_toolbar (GNOME_APP (widget), GTK_TOOLBAR (toolbar));
  gb_widget_create_from (toolbar, "GtkToolbar");
  gb_widget_create_from (toolbar->parent, "BonoboDockItem");

  gb_gnome_app_add_toolbar_button (GTK_TOOLBAR (toolbar), GTK_STOCK_NEW,
				   _("New File"));
  gb_gnome_app_add_toolbar_button (GTK_TOOLBAR (toolbar), GTK_STOCK_OPEN,
				   _("Open File"));
  gb_gnome_app_add_toolbar_button (GTK_TOOLBAR (toolbar), GTK_STOCK_SAVE,
				   _("Save File"));


  /* Statusbar */
  gnome_app_set_statusbar (GNOME_APP (widget),
			   gb_widget_new ("GnomeAppBar", widget));
  gb_widget_set_child_name (GNOME_APP (widget)->statusbar, GladeChildGnomeAppBar);

  /* We need to size the placeholders or the dialog is very small. */
  placeholder = editor_new_placeholder ();
  gtk_widget_set_usize (placeholder, 300, 200);
  gnome_app_set_contents (GNOME_APP (widget), placeholder);
}
开发者ID:AriaAsuka,项目名称:deadbeef,代码行数:47,代码来源:gnomeapp.c


示例15: gtk_vbox_new

GtkWidget *toolbar_init(GtkWindow *parent)
{
	GtkWidget *vbox = gtk_vbox_new(FALSE, 0);
	GtkToolbar *toolbar;
	GtkActionGroup *ag = gtk_action_group_new("Actions");
	gtk_action_group_add_actions(ag, action_items,
					G_N_ELEMENTS(action_items), parent);
	gtk_action_group_add_toggle_actions(ag, toggle_items,
					G_N_ELEMENTS(toggle_items), parent);

	GtkUIManager *ui = gtk_ui_manager_new();
	g_object_set_data(G_OBJECT(parent), "ui_manager", ui);
	gtk_ui_manager_insert_action_group(ui, ag, 0);
	GtkAccelGroup *accel = gtk_ui_manager_get_accel_group(ui);
	gtk_window_add_accel_group(parent, accel);

	GError *error = NULL;
        if (!gtk_ui_manager_add_ui_from_string (ui, ui_xml, -1, &error)) {
                g_message ("building menus failed: %s", error->message);
                g_error_free (error);
                exit (-1);
        }

	GtkWidget *menubar = gtk_ui_manager_get_widget(ui, "/menubar");
	gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(menubar), FALSE, TRUE, 0);
	toolbar = GTK_TOOLBAR(gtk_ui_manager_get_widget(ui, "/toolbar"));
	gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(toolbar), FALSE, TRUE, 0);

	/* Device selection GtkComboBox */
	GtkToolItem *toolitem = gtk_tool_item_new();
	GtkWidget *dev = dev_select_combo_box_new(parent);

	gtk_container_add(GTK_CONTAINER(toolitem), dev);
	gtk_toolbar_insert(toolbar, toolitem, 0);

	/* Time/Samples entry */
	toolitem = gtk_tool_item_new();
	GtkWidget *timesamples = gtk_entry_new();
	gtk_entry_set_text(GTK_ENTRY(timesamples), "100");
	gtk_entry_set_alignment(GTK_ENTRY(timesamples), 1.0);
	gtk_widget_set_size_request(timesamples, 100, -1);
	gtk_container_add(GTK_CONTAINER(toolitem), timesamples);
	gtk_toolbar_insert(toolbar, toolitem, 7);

	/* Time unit combo box */
	toolitem = gtk_tool_item_new();
	GtkWidget *timeunit = gtk_combo_box_new_text();
	gtk_combo_box_append_text(GTK_COMBO_BOX(timeunit), "samples");
	gtk_combo_box_append_text(GTK_COMBO_BOX(timeunit), "ms");
	gtk_combo_box_append_text(GTK_COMBO_BOX(timeunit), "s");
	gtk_combo_box_set_active(GTK_COMBO_BOX(timeunit), 0);
	gtk_container_add(GTK_CONTAINER(toolitem), timeunit);
	gtk_toolbar_insert(toolbar, toolitem, 8);

	g_object_set_data(G_OBJECT(parent), "timesamples", timesamples);
	g_object_set_data(G_OBJECT(parent), "timeunit", timeunit);

	return GTK_WIDGET(vbox);
}
开发者ID:gsmcmullin,项目名称:sigrok,代码行数:59,代码来源:toolbar.c


示例16: nautilus_toolbar_constructed

static void
nautilus_toolbar_constructed (GObject *obj)
{
	NautilusToolbar *self = NAUTILUS_TOOLBAR (obj);
	GtkToolItem *item;
	GtkWidget *hbox, *toolbar, *search;
	GtkStyleContext *context;
	const gchar *ui;

	G_OBJECT_CLASS (nautilus_toolbar_parent_class)->constructed (obj);

	gtk_style_context_set_junction_sides (gtk_widget_get_style_context (GTK_WIDGET (self)),
					      GTK_JUNCTION_BOTTOM);

	/* add the UI */
	ui = nautilus_ui_string_get ("nautilus-toolbar-ui.xml");
	self->priv->ui_manager = gtk_ui_manager_new ();
	gtk_ui_manager_add_ui_from_string (self->priv->ui_manager, ui, -1, NULL);
	gtk_ui_manager_insert_action_group (self->priv->ui_manager, self->priv->action_group, 0);

	toolbar = gtk_ui_manager_get_widget (self->priv->ui_manager, "/Toolbar");
	self->priv->toolbar = toolbar;

	context = gtk_widget_get_style_context (toolbar);
	gtk_style_context_add_class (context, GTK_STYLE_CLASS_PRIMARY_TOOLBAR);

	search = gtk_ui_manager_get_widget (self->priv->ui_manager, "/Toolbar/Search");
	gtk_style_context_add_class (gtk_widget_get_style_context (search), GTK_STYLE_CLASS_RAISED);

	gtk_box_pack_start (GTK_BOX (self), self->priv->toolbar, TRUE, TRUE, 0);
	gtk_widget_show_all (self->priv->toolbar);

	hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_widget_show (hbox);

	/* regular path bar */
	self->priv->path_bar = g_object_new (NAUTILUS_TYPE_PATH_BAR, NULL);
	gtk_box_pack_start (GTK_BOX (hbox), self->priv->path_bar, TRUE, TRUE, 0);

	/* entry-like location bar */
	self->priv->location_bar = nautilus_location_bar_new ();
	gtk_box_pack_start (GTK_BOX (hbox), self->priv->location_bar, TRUE, TRUE, 0);

	item = gtk_tool_item_new ();
	gtk_tool_item_set_expand (item, TRUE);
	gtk_container_add (GTK_CONTAINER (item), hbox);
	gtk_toolbar_insert (GTK_TOOLBAR (self->priv->toolbar), item, 0);
	gtk_widget_show (GTK_WIDGET (item));

	/* search bar */
	self->priv->search_bar = nautilus_search_bar_new ();
	gtk_box_pack_start (GTK_BOX (self), self->priv->search_bar, TRUE, TRUE, 0);

	g_signal_connect_swapped (nautilus_preferences,
				  "changed::" NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY,
				  G_CALLBACK (toolbar_update_appearance), self);

	toolbar_update_appearance (self);
}
开发者ID:dtrebbien,项目名称:nautilus,代码行数:59,代码来源:nautilus-toolbar.c


示例17: icon

/*!
    \param toolbar object add to it
    \param name name of the action and also display it in tooltip
    \param icon_path Address of the icon (It can be NULL)
*/
GtkAction*
ijadi_gui_create_action_s (GtkWidget *toolbar,const gchar *name, const gchar *stock_id)
{
	GtkAction *action = gtk_action_new(name, name,name,stock_id);
	GtkWidget *toolItem = gtk_action_create_tool_item(action);
	gtk_toolbar_insert (GTK_TOOLBAR(toolbar),GTK_TOOL_ITEM(toolItem),-1);
	return action;
}
开发者ID:bijanbina,项目名称:Ijadi,代码行数:13,代码来源:ijadi-gui.c


示例18: change_toolbar_style

static void
change_toolbar_style (GtkWidget *option_menu, GtkWidget *toolbar)
{
  GtkToolbarStyle style;

  style = gtk_option_menu_get_history (GTK_OPTION_MENU (option_menu));
  gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), style);
}
开发者ID:Aridna,项目名称:gtk2,代码行数:8,代码来源:testtoolbar.c


示例19: main

int main(int argc, char *argv[])
{
    GtkWidget *window;
    GtkWidget *widget;
    GtkWidget *label;
    GtkWidget *vbox;

    GtkWidget *toolbar;
    GtkToolItem *font;

    gtk_init(&argc, &argv);

    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
    gtk_window_set_default_size(GTK_WINDOW(window), 280, 200);
    gtk_window_set_title(GTK_WINDOW(window), "Color Selection Dialog");

    vbox = gtk_vbox_new(FALSE, 0);
    gtk_container_add(GTK_CONTAINER(window), vbox);

    toolbar = gtk_toolbar_new();
    gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS);

    gtk_container_set_border_width(GTK_CONTAINER(toolbar), 2);

    font = gtk_tool_button_new_from_stock(GTK_STOCK_SELECT_COLOR);
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), font, -1);

    gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 5);

    label = gtk_label_new("ZetCode");
    gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
    gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, FALSE, 5);

    g_signal_connect(G_OBJECT(font), "clicked",
        G_CALLBACK(select_font), label);

    g_signal_connect_swapped(G_OBJECT(window), "destroy",
        G_CALLBACK(gtk_main_quit), NULL);

    gtk_widget_show_all(window);

    gtk_main();

    return 0;
}
开发者ID:d1v0id,项目名称:GtkLessons,代码行数:46,代码来源:colorsel.c


示例20: cm_create_toolbar

static void cm_create_toolbar(CookieManagerPage *cmp)
{
    CookieManagerPagePrivate *priv = cmp->priv;
    GtkWidget *toolbar;
    GtkToolItem *toolitem;

    priv->toolbar = toolbar = gtk_toolbar_new();
    toolitem = gtk_tool_button_new_from_stock(GTK_STOCK_DELETE);
    gtk_tool_item_set_is_important(toolitem, TRUE);
    g_signal_connect(toolitem, "clicked", G_CALLBACK(cm_button_delete_clicked_cb), cmp);
    gtk_widget_show(GTK_WIDGET(toolitem));
    gtk_widget_set_sensitive(GTK_WIDGET(toolitem), FALSE);
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), toolitem, -1);
    priv->delete_button = GTK_WIDGET(toolitem);

    toolitem = gtk_tool_button_new_from_stock(GTK_STOCK_DELETE);
    gtk_tool_button_set_label(GTK_TOOL_BUTTON(toolitem), _("Delete All"));
    gtk_tool_item_set_tooltip_text(toolitem,
                                   _("Deletes all shown cookies. "
                                     "If a filter is set, only those cookies are deleted which match the filter."));
    gtk_tool_item_set_is_important(toolitem, TRUE);
    g_signal_connect(toolitem, "clicked", G_CALLBACK(cm_button_delete_all_clicked_cb), cmp);
    gtk_widget_show(GTK_WIDGET(toolitem));
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), toolitem, -1);
    priv->delete_all_button = GTK_WIDGET(toolitem);

    toolitem = gtk_separator_tool_item_new();
    gtk_separator_tool_item_set_draw(GTK_SEPARATOR_TOOL_ITEM(toolitem), FALSE);
    gtk_tool_item_set_expand(toolitem, TRUE);
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), toolitem, -1);
    gtk_widget_show(GTK_WIDGET(toolitem));

    toolitem = gtk_tool_button_new_from_stock(GTK_STOCK_ADD);
    gtk_tool_item_set_tooltip_text(toolitem, _("Expand All"));
    g_signal_connect(toolitem, "clicked", G_CALLBACK(cm_tree_popup_expand_activate_cb), cmp);
    gtk_widget_show(GTK_WIDGET(toolitem));
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), toolitem, -1);
    priv->expand_buttons[0] = GTK_WIDGET(toolitem);

    toolitem = gtk_tool_button_new_from_stock(GTK_STOCK_REMOVE);
    gtk_tool_item_set_tooltip_text(toolitem, _("Collapse All"));
    g_signal_connect(toolitem, "clicked", G_CALLBACK(cm_tree_popup_collapse_activate_cb), cmp);
    gtk_widget_show(GTK_WIDGET(toolitem));
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), toolitem, -1);
    priv->expand_buttons[1] = GTK_WIDGET(toolitem);
}
开发者ID:sinoory,项目名称:webv8,代码行数:46,代码来源:cookie-manager-page.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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