Re: no focus on a widget [message #66162 is a reply to message #66024] |
Wed, 15 April 2009 06:26  |
Allan Whiteford
Messages: 117 Registered: June 2006
|
Senior Member |
|
|
Jean H. wrote:
> Hi all,
>
> I have a program that, depending on the data, opens a widget and
> requires user action, or simply opens the widget, triggers a timer
> event, which, among other, closes the widget. This is repeated several
> times, like 30 times in a second.
>
> This is working well, but when every widget is closed by the timer
> event, it creates a unpleasing flickering as the Workbench (or whatever
> application I have running), constantly get and loose the focus. Is it
> possible to realize a widget without giving it the focus?
>
> In case someone is tempted by the fix "don't use the timer, don't use
> the widget", I can't really... it would be too much work for just an
> cosmetic problem, as most required functions used widget_control et al.
>
> Thanks in advance if you have any idea!
>
> Ah, one more thing, the program should run under windows and linux.. I
> haven't checked yet if this effect also happens on linux.
>
> Jean
Jean,
If you know in advance (i.e. before you draw it) you're not going to use
the widget can you just set map=0 to the base of the widget when you
create it?
This should (untested!) still allow your timer events and various
widget_controls to work without having to re-factor any code but will
stop it appearing on the screen.
Thanks,
Allan
|
|
|