Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Screen capture and Menus
Screen capture and Menus [message #445364] Thu, 04 November 2004 13:25 Go to next message
Larry Bergman is currently offline Larry BergmanFriend
Messages: 3
Registered: July 2009
Junior Member
I'm working on a screen capture utility. I'm able to grab images of
Controls, but am strugging with popup Menus. There seem to be two
problems. First, it appears that there's no way to determine the Menu
location. Menu has no getBounds method. Although MenuItem has a
getBounds, it seems to always return (0,0,0,0).

The second problem is in capturing the Menu rendering. I've tried
grabbing the display when the SWT.Show event is issued, and also when the
SWT.Selection event is issued. In neither is the Menu visible. I have a
hunch that because the menu is handled by the OS, it is never actually
"visible" to SWT.

Can anyone give me tips that might help with getting my screen capture to
handle this case?

Thanks much,
Larry
Re: Screen capture and Menus [message #445395 is a reply to message #445364] Thu, 04 November 2004 22:32 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
The menu is visible but SWT.Show comes before the menu is shown (so you can
add and delete items) and SWT.Selection comes after the menu is hidden. If
you call Display.asyncExec() to run the screen capture code after SWT.Show
completes, then you should be able to get a screen shot that includes the
menu. I haven't tried it but it should work.

"Larry Bergman" <bergman@us.ibm.com> wrote in message
news:cmdak2$cf3$1@eclipse.org...
> I'm working on a screen capture utility. I'm able to grab images of
> Controls, but am strugging with popup Menus. There seem to be two
> problems. First, it appears that there's no way to determine the Menu
> location. Menu has no getBounds method. Although MenuItem has a
> getBounds, it seems to always return (0,0,0,0).
>
> The second problem is in capturing the Menu rendering. I've tried
> grabbing the display when the SWT.Show event is issued, and also when the
> SWT.Selection event is issued. In neither is the Menu visible. I have a
> hunch that because the menu is handled by the OS, it is never actually
> "visible" to SWT.
>
> Can anyone give me tips that might help with getting my screen capture to
> handle this case?
>
> Thanks much,
> Larry
>
Previous Topic:Controling the CLOSE decoration on a Shell
Next Topic:PLZ REPLY: JNI does NOT work under workbench!
Goto Forum:
  


Current Time: Thu Apr 25 13:25:41 GMT 2024

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

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

Back to the top