Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Menu not showing, even though isVisible() says true
Menu not showing, even though isVisible() says true [message #447004] Tue, 07 December 2004 12:19 Go to next message
Eclipse UserFriend
I have a JFrame embedded in an editor, and I'm wrapping calls that used
to show JPopupMenus to SWT and wanting a Menu to popup. I've got the
thread accesses all set, but this is what happens:
When I create a Menu, I have to choose a parent. I set the parent to
be the composite that the JFrame embeds in. The first time I click on
the particular object, I route the request for the popup to SWT and show
a Menu. That displays. If I right click again at the same spot, debug
printouts show the request coming all the way again, the location is
right, the same code, and I even call Menu.isVisible() and it says true
after I call setVisible(true), but the Menu is nowhere to be found. Any
ideas?

Thank you,
Eddie
Re: Menu not showing, even though isVisible() says true [message #447064 is a reply to message #447004] Wed, 08 December 2004 00:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: our_snaps.sify.com

just try adding an appropriate listener to the composite.
just a suggestion









Eddie Galvez wrote:

> I have a JFrame embedded in an editor, and I'm wrapping calls that used
> to show JPopupMenus to SWT and wanting a Menu to popup. I've got the
> thread accesses all set, but this is what happens:
> When I create a Menu, I have to choose a parent. I set the parent to
> be the composite that the JFrame embeds in. The first time I click on
> the particular object, I route the request for the popup to SWT and show
> a Menu. That displays. If I right click again at the same spot, debug
> printouts show the request coming all the way again, the location is
> right, the same code, and I even call Menu.isVisible() and it says true
> after I call setVisible(true), but the Menu is nowhere to be found. Any
> ideas?

> Thank you,
> Eddie
Re: Menu not showing, even though isVisible() says true [message #447076 is a reply to message #447064] Wed, 08 December 2004 09:47 Go to previous messageGo to next message
Eclipse UserFriend
Can you elaborate?

Thing is, I don't want the popup menu to be triggered based on mouse
events as seen by SWT; the Swing JFrame has its own stuff, and what I've
done is when a JPopupMenu would be showing (the library being used has
special events for that), I route the call to SWT and want to show a
popup menu then.

di wrote:
> just try adding an appropriate listener to the composite.
> just a suggestion
Re: Menu not showing, even though isVisible() says true [message #447111 is a reply to message #447004] Wed, 08 December 2004 13:18 Go to previous messageGo to next message
Eclipse UserFriend
Are you sure it still has some MenuItems at the second hit?
If it has none, I guess setVisible(true) would succeed but
you wouldn't see anything?

Paul Singleton

Eddie Galvez wrote:
> I have a JFrame embedded in an editor, and I'm wrapping calls that used
> to show JPopupMenus to SWT and wanting a Menu to popup. I've got the
> thread accesses all set, but this is what happens:
> When I create a Menu, I have to choose a parent. I set the parent to be
> the composite that the JFrame embeds in. The first time I click on the
> particular object, I route the request for the popup to SWT and show a
> Menu. That displays. If I right click again at the same spot, debug
> printouts show the request coming all the way again, the location is
> right, the same code, and I even call Menu.isVisible() and it says true
> after I call setVisible(true), but the Menu is nowhere to be found. Any
> ideas?
>
> Thank you,
> Eddie
Re: Menu not showing, even though isVisible() says true [message #447117 is a reply to message #447111] Wed, 08 December 2004 15:46 Go to previous messageGo to next message
Eclipse UserFriend
Certain.

This may be interesting to note also: A menu listener receives
menuShown in the first case when it actually shows. In the second case,
where the menu says its visible but doesnt show, no menuShown event is
ever received.

- Eddie

Paul Singleton wrote:
> Are you sure it still has some MenuItems at the second hit?
> If it has none, I guess setVisible(true) would succeed but
> you wouldn't see anything?
>
> Paul Singleton
Re: Menu not showing, even though isVisible() says true [message #447210 is a reply to message #447004] Thu, 09 December 2004 10:46 Go to previous message
Eclipse UserFriend
Even though isVisible() says that a control is visible, the control might
not actually have painted until you get back to the event loop. This may be
what you are seeing with menus. You'll need a stand alone snippet so that
we can debug this.

"Eddie Galvez" <eddie@streambase.com> wrote in message
news:cp4omg$mfr$1@www.eclipse.org...
> I have a JFrame embedded in an editor, and I'm wrapping calls that used
> to show JPopupMenus to SWT and wanting a Menu to popup. I've got the
> thread accesses all set, but this is what happens:
> When I create a Menu, I have to choose a parent. I set the parent to
> be the composite that the JFrame embeds in. The first time I click on
> the particular object, I route the request for the popup to SWT and show
> a Menu. That displays. If I right click again at the same spot, debug
> printouts show the request coming all the way again, the location is
> right, the same code, and I even call Menu.isVisible() and it says true
> after I call setVisible(true), but the Menu is nowhere to be found. Any
> ideas?
>
> Thank you,
> Eddie
Previous Topic:how to get keyboard modifiers when klicking a table header
Next Topic:Native Close Button
Goto Forum:
  


Current Time: Fri Jul 25 01:11:22 EDT 2025

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

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

Back to the top