no focus on a widget [message #66024] |
Tue, 14 April 2009 11:36  |
Jean H.
Messages: 472 Registered: July 2006
|
Senior Member |
|
|
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
|
|
|
Re: no focus on a widget [message #66161 is a reply to message #66024] |
Wed, 15 April 2009 07:31  |
Jean H.
Messages: 472 Registered: July 2006
|
Senior Member |
|
|
> 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
>
Thanks for the tip Allan! I missed the map=0 keyword in my investigations...
Doing this does 2/3 of the job.. 1) the widget is not shown, 2) if I run
another application than IDL, I don't see any flickering (i.e. the
application keep the focus), but, strange enough, IDL still gets and
loose the focus (not if IDL is iconised)!!! It is very strange since no
window is created... anyways, thanks a lot, as what I needed is met!
Jean
|
|
|
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
|
|
|