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

Home » Public Forums » archive » Re: Two widget questions
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Two widget questions [message #17712] Mon, 08 November 1999 00:00 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
pln@egret1.stanford.edu (Patrick L. Nolan) writes:
>
> 2. My base window contains a menu bar, a scrolling list, and a draw
> widget. I want to handle resize events properly. At first I resized
> the draw widget to event.x and event.y. This doesn't work properly
> because of the space occupied by the menu bar and list. The user
> moves the window corner to the desired place, and then the thing
> grows a bit. By experimenting I found approximately how much padding
> is required to make it come out right, but this is a very fragile
> solution.
>
> So far I haven't found a reliable solution. I have been trying to
> use widget_info(/geometry) and widget_control,/tlb_get_size to
> find the actual sizes of the draw and base widgets before and after
> the resize. Unfortunately the results don't seem to be reliable, or
> I just don't understand how to interpret them. Indeed, the manual
> says that widget_info(/geometry) returns an incorrect value if there
> is a menu bar.
>
> Is there some general way to deal with this? Have I just missed
> the proper section in the book?


I never found a textbook way to solve this problem. The resizing bug
is truly a nuisance. Here is my best solution:

1. Create an encapsulating top level base with xpad=0 ypad=0 and then
put your practical top level base within that. Example:

tlb0 = widget_base(column=1, tlb_size_events=1, xpad=0, ypad=0)
tlb = widget_base(tlb0, column=1)
... fill up the tlb base ...

This doesn't work if you insist on a top-level menu. You can
create an IDL menu under tlb if you need to.

However, this seems to take care of the growing widget problem.
The rest of the steps are optional if you decide to add a menu
widget.

2. Create a menu if you need it under tlb.

3. Realize the widget and get the size of the menu.

4. If needed, enlarge the window to fully encompass the menu.

5. When resize events come, resize the widget taking into account the
menu size.

Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Given many images, find bounding box
Next Topic: Re: where() and IEEE NaN and other stuff...

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

Current Time: Sat Oct 11 04:21:16 PDT 2025

Total time taken to generate the page: 0.36154 seconds