Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » awt menubar in a rcp swt-awt wrapper frame
awt menubar in a rcp swt-awt wrapper frame [message #459810] Wed, 17 August 2005 14:59 Go to next message
benny is currently offline bennyFriend
Messages: 3
Registered: July 2009
Junior Member
Hello,

I'm just programming a simple rcp application with one view. In this view
I test the SWT-AWT Wrapper class.
In the createControlPart() method of the view I wrote this:

Composite awtContainer = new Composite(parent, SWT.EMBEDDED);
Frame curtFrame = SWT_AWT.new_Frame(awtContainer);

MenuBar menubar = new MenuBar();
Menu fileMenu = new Menu("File");
fileMenu.add(new MenuItem("Open"));
fileMenu.add(new MenuItem("Close"));
menubar.add(fileMenu);

curtFrame.setMenuBar(menubar);

But I can't see my menubar. Is it possible to add a awt menubar to a awt
frame in a swt rcp window? What's wrong with my code?

Thanks in advance
Benny
Re: awt menubar in a rcp swt-awt wrapper frame [message #460389 is a reply to message #459810] Wed, 24 August 2005 13:56 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
This won't work. An EmbeddedFrame can't have its own menu bar and AWT
doesn't access the native menu bar created by SWT.

"benny" <the_dude_jeff_lebowski@yahoo.de> wrote in message
news:11edf9e88ecd4a406764c6e0bfdd9100$1@www.eclipse.org...
> Hello,
>
> I'm just programming a simple rcp application with one view. In this view
> I test the SWT-AWT Wrapper class.
> In the createControlPart() method of the view I wrote this:
>
> Composite awtContainer = new Composite(parent, SWT.EMBEDDED);
> Frame curtFrame = SWT_AWT.new_Frame(awtContainer);
>
> MenuBar menubar = new MenuBar();
> Menu fileMenu = new Menu("File");
> fileMenu.add(new MenuItem("Open"));
> fileMenu.add(new MenuItem("Close"));
> menubar.add(fileMenu);
>
> curtFrame.setMenuBar(menubar);
>
> But I can't see my menubar. Is it possible to add a awt menubar to a awt
> frame in a swt rcp window? What's wrong with my code?
>
> Thanks in advance
> Benny
>
Previous Topic:Combo Box Size
Next Topic:Image in Tree
Goto Forum:
  


Current Time: Sat Apr 27 05:06:43 GMT 2024

Powered by FUDForum. Page generated in 1.49249 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top