comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Widget Weirdness
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Widget Weirdness [message #65642] Fri, 13 March 2009 12:49 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> *NOW* what happens is that the widget jumps back to
> its starting position, but only *SOME* of the time.
> This is unreal!! Apparently now there is some interaction
> going on, such that if the text of the label widget changes
> its length "appreciably" then this jumpy behavior occurs,
> but if the text is the same length as the previous text,
> the jumpy behavior doesn't occur.

OK, I think I have a handle on this now. On UNIX,
if you position a TLB widget on the display with
XOFFSET and YOFFSET keywords, and that widget program
has a label widget rendered in its "natural" size
(ie., you have not specified a size), and the label widget
has the DYNAMIC_RESIZE keyword set for it, then if you
change the text on that label widget to an appreciably
different size, the TLB widget will jump back to its
original starting position.

One way around the problem is to assign a size to the
label widget. Another way around the problem is
to not position the TLB widget on the display (ugly).

If you think I have gone completely off my rocker,
you can have a look yourself. You can find my test
program here:

http://www.dfanning.com/misc/jumpywidget.pro

Run it like this:

IDL> void = jumpywidget()

Or, to see it work correctly:

IDL> void = jumpywidget(/NoJumping)

Cheers,

David

--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Widget Weirdness [message #65646 is a reply to message #65642] Fri, 13 March 2009 11:53 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> I finally got my little test widget program to exhibit
> the symptoms of this problem. It turns out that two
> things are necessary for the problem to show itself.
>
> Just to recap the problem. I have a centered widget.
> If I move the widget off-center (on the display), then
> create an event that changes the text of a label widget,
> the entire widget jumps back to the center of the display.
> This happens ONLY on UNIX machines.
>
> As I say, there are two requirements for this to occur.
>
> First, I have to locate the widget on the display using
> the [XY]OFFSET keywords.
>
> Widget_Control, tlb, XOFFSET=400, YOFFSET=400
>
> It doesn't matter if I do this before or after the
> widget is realized, or if I do it as shown or if I
> do it in the TLB creation routine. It only matters
> that I assign a location to the widget. It doesn't
> matter if the widget is centered necessarily. The
> widget will pop back to this original offset location,
> whatever it happens to be.
>
> Second, I have to use the UPDATE keyword to
> turn updates off and on for the top-level base. In my
> test program, the code looks like this:
>
> Widget_Control, event.top, Update=0
> Widget_Control, event.top, Update=1
> Widget_Control, labelID, Set_Value=newText
>
> If I don't do *both* of these things, my widget acts
> like it is suppose to.

Wait a minute! It is not this simple.

OK, I am still positioning my widget with offsets,
as before, but I have removed ALL updating from my
widget.

*NOW* what happens is that the widget jumps back to
its starting position, but only *SOME* of the time.
This is unreal!! Apparently now there is some interaction
going on, such that if the text of the label widget changes
its length "appreciably" then this jumpy behavior occurs,
but if the text is the same length as the previous text,
the jumpy behavior doesn't occur.

I feel like I am in some kind of twilight zone episode!

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Widget Weirdness [message #65654 is a reply to message #65646] Fri, 13 March 2009 08:45 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Well, this is a weird one. I've been able to duplicate
> the problem with other programs, just by changing
> the text of a label widget, but--naturally--when
> I make a simple test case nada. Going to be a long
> night, probably...

Yikes! Talk about weird.

I finally got my little test widget program to exhibit
the symptoms of this problem. It turns out that two
things are necessary for the problem to show itself.

Just to recap the problem. I have a centered widget.
If I move the widget off-center (on the display), then
create an event that changes the text of a label widget,
the entire widget jumps back to the center of the display.
This happens ONLY on UNIX machines.

As I say, there are two requirements for this to occur.

First, I have to locate the widget on the display using
the [XY]OFFSET keywords.

Widget_Control, tlb, XOFFSET=400, YOFFSET=400

It doesn't matter if I do this before or after the
widget is realized, or if I do it as shown or if I
do it in the TLB creation routine. It only matters
that I assign a location to the widget. It doesn't
matter if the widget is centered necessarily. The
widget will pop back to this original offset location,
whatever it happens to be.

Second, I have to use the UPDATE keyword to
turn updates off and on for the top-level base. In my
test program, the code looks like this:

Widget_Control, event.top, Update=0
Widget_Control, event.top, Update=1
Widget_Control, labelID, Set_Value=newText

If I don't do *both* of these things, my widget acts
like it is suppose to.

Do you think there is any chance anyone at ITTVIS will
believe me?

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Widget Weirdness [message #65661 is a reply to message #65654] Fri, 13 March 2009 02:58 Go to previous messageGo to next message
Allan Whiteford is currently offline  Allan Whiteford
Messages: 117
Registered: June 2006
Senior Member
David Fanning wrote:
> Folks,
>
> I just ran into this problem on my Linux machine. I wonder
> if someone can help me test. I ran my Coyote program
> PickColorName:
>
> IDL> c = pickcolorname()
>
> This puts a widget up in the center of the display. I
> then move it off to the side and pick a color. As soon
> as I do, the widget jumps back to the center of the
> display. This is decidedly NOT what it is suppose to do!
>
> I've traced the program (believe it or not) to a command
> in which I am changing the text on a label widget. I have
> confirmed this behaviour with an entirely different program.
> It, too, jumps if I try to change a widget label's text.
>
> Is this a function of my window manager (SUSE 10.? and
> KDE 3.5, I believe), or is this a UNIX (possibly Mac)
> problem in general? If it is a general bug, I would
> like to report it.
>
> Thanks,
>
> David

David,

Running on:

{ x86 linux unix linux 6.2 Jun 20 2005 32 64}

I don't see the problem but running on:

{ x86 linux unix linux 7.0 Oct 25 2007 32 64}

the problem exists exactly as other people have confirmed.

Although it could just as easily be the OS (FC4 vs FC8 respectively).

I'm using fvwm95 as my window manager which is about as far from a
bloated desktop environment as you can get. This pretty much leaves it
with either a fault in X or a fault in IDL.

Perhaps it's related to using dynamic_resize in the widget_label? That
can change the size of the widget which might cause something to think
it needs repositioned. Might help in tracking down the issue.

Thanks,

Allan
Re: Widget Weirdness [message #65663 is a reply to message #65661] Thu, 12 March 2009 19:49 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mike writes:

> Same weird behavior:
>
> IDL> print, !version
> { i386 darwin unix Mac OS X 7.0 Oct 25 2007 32 64}

Well, this is a weird one. I've been able to duplicate
the problem with other programs, just by changing
the text of a label widget, but--naturally--when
I make a simple test case nada. Going to be a long
night, probably...

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Widget Weirdness [message #65665 is a reply to message #65663] Thu, 12 March 2009 16:56 Go to previous messageGo to next message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
David Fanning wrote:
> Folks,
>
> I just ran into this problem on my Linux machine. I wonder
> if someone can help me test. I ran my Coyote program
> PickColorName:
>
> IDL> c = pickcolorname()
>
> This puts a widget up in the center of the display. I
> then move it off to the side and pick a color. As soon
> as I do, the widget jumps back to the center of the
> display. This is decidedly NOT what it is suppose to do!
>
> I've traced the program (believe it or not) to a command
> in which I am changing the text on a label widget. I have
> confirmed this behaviour with an entirely different program.
> It, too, jumps if I try to change a widget label's text.
>
> Is this a function of my window manager (SUSE 10.? and
> KDE 3.5, I believe), or is this a UNIX (possibly Mac)
> problem in general? If it is a general bug, I would
> like to report it.
>
> Thanks,
>
> David

Same weird behavior:

IDL> print, !version
{ i386 darwin unix Mac OS X 7.0 Oct 25 2007 32 64}

Mike
--
www.michaelgalloy.com
Associate Research Scientist
Tech-X Corporation
Re: Widget Weirdness [message #65667 is a reply to message #65665] Thu, 12 March 2009 16:45 Go to previous messageGo to next message
Andrew Cool is currently offline  Andrew Cool
Messages: 219
Registered: January 1996
Senior Member
On Mar 13, 8:27 am, David Fanning <n...@dfanning.com> wrote:
> Folks,
>
> I just ran into this problem on my Linux machine. I wonder
> if someone can help me test. I ran my Coyote program
> PickColorName:
>
>    IDL> c = pickcolorname()
>
> This puts a widget up in the center of the display. I
> then move it off to the side and pick a color. As soon
> as I do, the widget jumps back to the center of the
> display. This is decidedly NOT what it is suppose to do!
>
> I've traced the program (believe it or not) to a command
> in which I am changing the text on a label widget. I have
> confirmed this behaviour with an entirely different program.
> It, too, jumps if I try to change a widget label's text.
>
> Is this a function of my window manager (SUSE 10.? and
> KDE 3.5, I believe), or is this a UNIX (possibly Mac)
> problem in general? If it is a general bug, I would
> like to report it.
>
> Thanks,
>
> David
> --
> David Fanning, Ph.D.
> Coyote's Guide to IDL Programming (www.dfanning.com)
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Ditto for IDL6.4 under Mandriva, KDE 3.4.2

Andrew
Re: Widget Weirdness [message #65668 is a reply to message #65667] Thu, 12 March 2009 15:46 Go to previous messageGo to next message
ben.bighair is currently offline  ben.bighair
Messages: 221
Registered: April 2007
Senior Member
On Mar 12, 6:27 pm, David Fanning <n...@dfanning.com> wrote:
> Folks,
>
> I just ran into this problem on my Linux machine. I wonder
> if someone can help me test. I ran my Coyote program
> PickColorName:
>
>    IDL> c = pickcolorname()
>
> This puts a widget up in the center of the display. I
> then move it off to the side and pick a color. As soon
> as I do, the widget jumps back to the center of the
> display. This is decidedly NOT what it is suppose to do!
>
> I've traced the program (believe it or not) to a command
> in which I am changing the text on a label widget. I have
> confirmed this behaviour with an entirely different program.
> It, too, jumps if I try to change a widget label's text.
>
> Is this a function of my window manager (SUSE 10.? and
> KDE 3.5, I believe), or is this a UNIX (possibly Mac)
> problem in general? If it is a general bug, I would
> like to report it.
>

Hi David,

Same weird behavior here.

IDL> c = pickcolorname()
% Compiled module: PICKCOLORNAME.
% Compiled module: GET_SCREEN_SIZE.
% Compiled module: XMANAGER.
IDL> print, !version
{ ppc darwin unix Mac OS X 6.3 Mar 23 2006 32 64}

Ben
Re: Widget Weirdness [message #65799 is a reply to message #65642] Wed, 18 March 2009 15:24 Go to previous message
Robert Moss, PhD is currently offline  Robert Moss, PhD
Messages: 29
Registered: November 2006
Junior Member
On Mar 13, 3:49 pm, David Fanning <n...@dfanning.com> wrote:
> David Fanning writes:
>> *NOW* what happens is that the widget jumps back to
>> its starting position, but only *SOME* of the time.
>> This is unreal!! Apparently now there is some interaction
>> going on, such that if the text of the label widget changes
>> its length "appreciably" then this jumpy behavior occurs,
>> but if the text is the same length as the previous text,
>> the jumpy behavior doesn't occur.
>
> OK, I think I have a handle on this now. On UNIX,
> if you position a TLB widget on the display with
> XOFFSET and YOFFSET keywords, and that widget program
> has a label widget rendered in its "natural" size
> (ie., you have not specified a size), and the label widget
> has the DYNAMIC_RESIZE keyword set for it, then if you
> change the text on that label widget to an appreciably
> different size, the TLB widget will jump back to its
> original starting position.
>
> One way around the problem is to assign a size to the
> label widget. Another way around the problem is
> to not position the TLB widget on the display (ugly).
>
> If you think I have gone completely off my rocker,
> you can have a look yourself. You can find my test
> program here:
>
>   http://www.dfanning.com/misc/jumpywidget.pro
>
> Run it like this:
>
>    IDL> void = jumpywidget()
>
> Or, to see it work correctly:
>
>    IDL> void = jumpywidget(/NoJumping)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Coyote's Guide to IDL Programming (www.dfanning.com)
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

I beleive you, but I still think you are off your rocker :P
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Mac Widget Limitation?
Next Topic: Double precision

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:22:29 PDT 2025

Total time taken to generate the page: 0.00453 seconds