pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Ziltener <zi...@lyrion.ch>
Subject Problems with MenuBar
Date Thu, 03 Mar 2011 15:19:07 GMT
Hi all,
It's me again... I'm trying to add a MenuBar to a window I created. So I
have a class MainWindow and a corresponding MainWindow.bxml.
The MainWindow extends Frame and implements Application and Bindable and is
essentially built like the "Menu Bars" sample on the pivot page, except that
I manually add the MenuBar:
I have a "@BXML MenuBar menuBar = null" which gets injected and then I use
"this.setMenuBar(menuBar)" in the initialize-Method to add the MenuBar to
the window. The problem is: There is no menubar displayed. I just keep
getting a window without a menubar.
My BXML-File is quite short, so I include it:

<?xml version="1.0" encoding="UTF-8"?>
<Window title="SemanticNotes" maximized="true" xmlns:bxml="
http://pivot.apache.org/bxml" xmlns="org.apache.pivot.wtk">
      <MenuBar xmlns:content="org.apache.pivot.wtk.content"
bxml:id="menuBar">
        <MenuBar.Item buttonData="Testmenu">
          <Menu.Section>
            <Menu.Item>
             <buttonData>
               <content:MenuItemData text="New" keyboardShortcut="CMD-N"/>
             </buttonData>
           </Menu.Item>
         </Menu.Section>
      </MenuBar.Item>
    </MenuBar>

    <Panel>
      <bxml:include src="BookPanel.bxml" />
    </Panel>
</Window>

What's wrong with that?

Mime
View raw message