gtk_widget_show( zlist );
gtk_box_pack_start( GTK_BOX( vbox2 ), zlist, TRUE, FALSE, 0 );
- menu = gtk_menu_new();
+ menu = ui::Menu();
gtk_widget_show( menu );
gtk_option_menu_set_menu( GTK_OPTION_MENU( zlist ), menu );
GtkMenuItem* item = ui::MenuItem( mnemonic, true );
gtk_widget_show( GTK_WIDGET( item ) );
- GtkWidget* sub_menu = gtk_menu_new();
+ GtkWidget* sub_menu = ui::Menu();
gtk_menu_item_set_submenu( item, sub_menu );
return item;
Label::Label(const char *label) : Label(GTK_LABEL(gtk_label_new(label)))
{ }
+ Menu::Menu() : Menu(GTK_MENU(gtk_menu_new()))
+ { }
+
MenuItem::MenuItem(const char *label, bool mnemonic) : MenuItem(GTK_MENU_ITEM((mnemonic ? gtk_menu_item_new_with_mnemonic : gtk_menu_item_new_with_label)(label)))
{ }
using ui_evkey = struct _GdkEventKey;
using ui_hbox = struct _GtkHBox;
using ui_label = struct _GtkLabel;
+using ui_menu = struct _GtkMenu;
using ui_menuitem = struct _GtkMenuItem;
using ui_modal = struct ModalDialog;
using ui_scrolledwindow = struct _GtkScrolledWindow;
Label(const char *label);
);
+ WRAP(Menu, Widget, ui_menu,
+ Menu();
+ );
+
WRAP(MenuItem, Widget, ui_menuitem,
MenuItem(const char *label, bool mnemonic = false);
);
if ( m_bPopup ) {
GtkWidget *menu, *item;
- menu = gtk_menu_new();
+ menu = ui::Menu();
item = ui::MenuItem( "Validate (RETURN)" );
gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( Textool_Validate ), NULL );
std::size_t nCount = pPlugIn->getCommandCount();
if ( nCount > 0 ) {
- menu = ui::Widget(gtk_menu_new());
+ menu = ui::Menu();
if ( g_Layout_enableDetachableMenus.m_value ) {
menu_tearoff( GTK_MENU( menu ) );
}
gtk_widget_show( item );
gtk_container_add( GTK_CONTAINER( menu ), item );
- subMenu = ui::Widget(gtk_menu_new());
+ subMenu = ui::Menu();
gtk_menu_item_set_submenu( GTK_MENU_ITEM( item ), subMenu );
menuStack.push( menu );
menu = subMenu;
void TextureBrowser_deleteTag();
void TextureBrowser_createContextMenu( ui::Widget treeview, GdkEventButton *event ){
- ui::Widget menu = ui::Widget(gtk_menu_new());
+ ui::Widget menu = ui::Menu();
ui::Widget menuitem = ui::MenuItem( "Add tag" );
g_signal_connect( menuitem, "activate", (GCallback)TextureBrowser_addTag, treeview );
{ // menu bar
menu_bar = ui::Widget(gtk_menu_bar_new());
- ui::Widget menu_view = ui::Widget(gtk_menu_new());
+ ui::Widget menu_view = ui::Menu();
auto view_item = TextureBrowser_constructViewMenu( GTK_MENU( menu_view ) );
gtk_menu_item_set_submenu( GTK_MENU_ITEM( view_item ), menu_view );
gtk_menu_bar_append( GTK_MENU_BAR( menu_bar ), view_item );
- ui::Widget menu_tools = ui::Widget(gtk_menu_new());
+ ui::Widget menu_tools = ui::Menu();
auto tools_item = TextureBrowser_constructToolsMenu( GTK_MENU( menu_tools ) );
gtk_menu_item_set_submenu( GTK_MENU_ITEM( tools_item ), menu_tools );
gtk_menu_bar_append( GTK_MENU_BAR( menu_bar ), tools_item );
TextureBrowser_buildTagList();
}
{ // tag menu bar
- ui::Widget menu_tags = ui::Widget(gtk_menu_new());
+ ui::Widget menu_tags = ui::Menu();
auto tags_item = TextureBrowser_constructTagsMenu( GTK_MENU( menu_tags ) );
gtk_menu_item_set_submenu( GTK_MENU_ITEM( tags_item ), menu_tags );
gtk_menu_bar_append( GTK_MENU_BAR( menu_bar ), tags_item );
gtk_widget_show( GTK_WIDGET( item ) );
container_add_widget( GTK_CONTAINER( m_stack.back().first ), GTK_WIDGET( item ) );
- GtkMenu* submenu = GTK_MENU( gtk_menu_new() );
+ GtkMenu* submenu = ui::Menu();
gtk_menu_item_set_submenu( item, GTK_WIDGET( submenu ) );
m_stack.push_back( MenuPair( submenu, name ) );
}
if ( m_mnuDrop == 0 ) { // first time, load it up
- GtkMenu* menu = m_mnuDrop = GTK_MENU( gtk_menu_new() );
+ GtkMenu* menu = m_mnuDrop = ui::Menu();
EntityClassMenuInserter inserter( menu );
GlobalEntityClassManager().forEach( inserter );