Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT.Show not called for child widgets?
SWT.Show not called for child widgets? [message #533779] Sun, 16 May 2010 19:49 Go to next message
Eclipse UserFriend
Dear All:

Just wondering if for a Text item, for example, there is a good event like SWT.Create that one could use (obviously SWT.Create does not exist).

SWT.Show would be nice, and I use it for shells, but it seems to _never_ be called for Text widgets (or MenuItem widgets for that matter) on GTK 64-bit Linux

Thank you!
Misha
Re: SWT.Show not called for child widgets? [message #533915 is a reply to message #533779] Mon, 17 May 2010 09:13 Go to previous messageGo to next message
Eclipse UserFriend
Misha Koshelev wrote:
> Dear All:
>
> Just wondering if for a Text item, for example, there is a good event
> like SWT.Create that one could use (obviously SWT.Create does not exist).

What are you trying to do, exactly? I mean, what usecase are you trying
to fulfill?

SWT.Show applies to Menus, not MenuItems or most other widgets.

In 3.6 there is an event that is called during the create lifecycle, but
it is also called during many other points in the lifecycle.

What about SWT.Activate on your text field, or SWT.FocusIn?

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm
Re: SWT.Show not called for child widgets? [message #533952 is a reply to message #533915] Mon, 17 May 2010 10:39 Go to previous messageGo to next message
Eclipse UserFriend
Thank you. I was looking for a convenient listener in which I could set the default value (retrieved from properties) of the Widget.

I have ended up going with SWT.Show on the parent shell.

Please let me know if you have better ideas (I am thinking that the SWT.Activate and FocusIn events do _not_ get called until the user actually activates the control - which would not be the correct time for my purposes - please correct me if I am wrong).

Thank you
Misha
Re: SWT.Show not called for child widgets? [message #534159 is a reply to message #533952] Tue, 18 May 2010 05:05 Go to previous messageGo to next message
Eclipse UserFriend
There are couple of ways for achieving this. During the SWT.Show event
of the shell, try to get the children of the shell and set it's default
properties.
Otherwise, you can consider SWT.Resize event for each widget, which
would be triggered when the widget is resized. Note that if the shell is
resized due to which if the widget is resized, then this event is
triggered again. So, you should use flags to check for the occurrence of
the event again.
I couldn't recollect any more better ideas at this moment.
Re: SWT.Show not called for child widgets? [message #534397 is a reply to message #534159] Tue, 18 May 2010 21:32 Go to previous message
Eclipse UserFriend
Thank you so much for your helpful advice.

Misha
Previous Topic:How to repair canvas?
Next Topic:How to print a whole big Tree widget
Goto Forum:
  


Current Time: Sun Jul 06 09:56:05 EDT 2025

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

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

Back to the top