[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: base widgets growing uncontrollably.... ?
Marc Schellens wrote:
>
> Paul van Delst wrote:
> > I'm seeing a weird effect with an IDL widget app I put together and I'm hoping someone
> > here might recognise the symptoms and inform me of some widget_base keyword I have
> > forgotten.
> >
> > I create a base within which I create several compound widgets (that I wrote) each, of
> > course, within it's own base. Currently I have three compund widgets in the base (all of
> > which contains exclusive button bases); two with column=1 and the third with grid_layout=1
> > and column=3. Now, when I add more buttons to the third compound widget (currently I have
> > three columns of five buttons), the size of the other compound widgets grow! It's at the
> > point now where half of the space in the widget display is just empty, dead space. If I
> > remove items from the third compund widget (which is always of a size such there is no
> > empty space) the dead space in the other two shrinks.
> >
> > Anyone have an idea what I'm doing wrong and how to fix it? I would rather not have to use
> > XSIZE/YSIZE/etc keywords.>
>
> As I understood you modify an already realized widget.
> I had similar experience, even without grid layout bases some time ago.
> What helped me was using:
>
> widget_control,tlb,UPDATE=0 (1)
>
> before (after) the modification.
> Thisway the sizes were correct and the speed the changes were
> carried out was drastically higher.
>
> Hope that helps,
WOOHOO! That did it! Inserting the UPDATE in the following code fixed the problem.
You're a star! This problem was annoying the crap outta me to the point of tossing and
turning at night.
Onya!
paulv
<-----not very pretty, >80 columns code follows------>
; -------------------------
; Create the widget display
; -------------------------
; Create the main bases
id = WIDGET_BASE( MAP = 0, COLUMN = 1 )
widget_control, id, update = 0 ; <---- new
base_id = WIDGET_BASE( id, $
GROUP_LEADER = id, $
MAP = map, $
ROW = 1 )
; -- Create the select base
select_base_id = WIDGET_BASE( base_id, $
GROUP_LEADER = id, $
MAP = map, $
COLUMN = 2 )
; Create the select sensor widget
select_sensor_id = rtview_select_sensor( select_base_id, $
GROUP_LEADER = select_base_id, $
MAP = map, $
debug = debug )
; Create the select profile widget
select_profile_id = rtview_select_profile( select_base_id, $
new_K.n_profiles, $
GROUP_LEADER = select_base_id, $
MAP = map, $
debug = debug )
; Create the select output widget
select_output_id = rtview_select_output( select_base_id, $
GROUP_LEADER = select_base_id, $
MAP = map, $
debug = debug )
; -- Create the display base
display_base_id = WIDGET_BASE( base_id, $
GROUP_LEADER = id, $
MAP = map, $
COLUMN = 1 )
; -- Create the display widget
display_id = rtview_display( display_base_id, $
GROUP_LEADER = display_base_id, $
MAP = map, $
debug = debug )
; Create the exit button
action_base_id = WIDGET_BASE( id, $
GROUP_LEADER = id, $
MAP = map, $
ROW = 1 )
quit_id = WIDGET_BUTTON( action_base_id, $
GROUP_LEADER = id, $
EVENT_PRO = 'rtview_event', $
ALIGN_CENTER = 1, $
VALUE = 'Done', $
XSIZE = 100 )
widget_control, id, update = 1 ; <---- new
; Realise and map the widget heirarchy
WIDGET_CONTROL, id, /REALIZE, MAP = 1
--
Paul van Delst A little learning is a dangerous thing;
CIMSS @ NOAA/NCEP Drink deep, or taste not the Pierian spring;
Ph: (301)763-8000 x7274 There shallow draughts intoxicate the brain,
Fax:(301)763-8545 And drinking largely sobers us again.
Alexander Pope.