Adding support to append Separator Items for MenuButton

Updated PanelBar to use this API
This commit is contained in:
Michael Fisher 2012-08-30 18:02:44 -05:00 committed by Ichthyostega
parent 00f29ea3d5
commit a86f3bf497
3 changed files with 29 additions and 4 deletions

View file

@ -101,6 +101,16 @@ MenuButton::append (const char *slug, const char* title,
append (uSlug, uTitle, callback);
}
void
MenuButton::appendSeparator()
{
uimanager->add_ui_separator(
uimanager->new_merge_id(),
ustring("ui/").append(POPUP_SLUG),
"Separator", Gtk::UI_MANAGER_SEPARATOR,
false);
}
void
MenuButton::popup()
{

View file

@ -79,9 +79,27 @@ public:
*/
Menu& get_menu();
/**
* Append a Menu Item to the Menu
* @param slug Unique identifier in the UI Manager
* @param title The title of the item
* @param callback The signal handler when clicked
*/
void append (uString &slug, uString &title, sigc::slot<void>& callback);
/**
* Append a Menu Item to the Menu
* @param slug Unique identifier in the UI Manager
* @param title The title of the item
* @param callback The signal handler when clicked
*/
void append (const char *slug, const char* title, sigc::slot<void>& callback);
/**
* Append a Gtk::SeparatorMenuItem to the Menu
*/
void appendSeparator();
/**
* Pops up the menu.
*/

View file

@ -83,10 +83,7 @@ PanelBar::setup_panel_button()
**/
}
FIXME("Update for gtk3");
#if 0
list.push_back( Menu_Helpers::SeparatorElem() );
#endif
panelButton.appendSeparator();
// Add extra commands
slot<void> hide = mem_fun(*this, &PanelBar::on_hide);