[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Two widget questions
- Subject: Two widget questions
- From: pln(at)egret1.stanford.edu (Patrick L. Nolan)
- Date: 8 Nov 1999 23:51:03 GMT
- Newsgroups: comp.lang.idl-pvwave
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:17175
I'm back with more questions about my first widget program.
My first question about flashing colors was solved nicely. Now
I'm getting into more advanced details.
1. Is it possible to have exclusive button under a menu bar?
I tried putting a widget_base,/exclusive or a cw_bgroup as
children of a menu bar button. In both cases it told me that
the parent was the wrong type.
I want to make a toggle between two mutually exclusive situations.
I have been faking it by making one of the buttons insensitive
and switching it when the other is pressed. This is not really
satisfactory because the currently active situation is represented
by the grayed-out button. I don't consider that intuitively obvious.
I don't want to have a single button whose "value" text changes,
because I want to make it clear that there are two choices.
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
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?
* Patrick L. Nolan
* W. W. Hansen Experimental Physics Laboratory (HEPL) *
* Stanford University *