I've been having a lot of trouble with a widget-layout issue, and not
having gotten anywhere, I'm submitting it to the collective wisdom of the
newsgroup.
Below is a greatly simplified test case, demonstrating the general
layout of a much larger program. Both of the frames contain draw widgets,
of the same size, on the right, but the labels (and buttons, in the real
one) on the left may be of different sizes. What I'd like to do is
right-justify the draw widgets in their bases, so that they line up
vertically. (In the real case, the lower plot is a difference of two
curves from the upper one.) I've tried numerous combinations of
/align_right and /base_align_right; making the frameBases column=2 instead
of row=1 then using /align_right and /base_align_right; putting the draw
widgets in their own bases and trying to align _those_; etc, etc. The
only thing I've found so far that works is /grid, but that makes the
controls as wide as the plot :-(
Thanks for your help. And no, rewriting to use !p.multi won't help,
because in the real program, the frames are each different instances of
classes that plot some data and have various controls for choosing which
curves to plot, change plot and curve properties, etc. I _said_ it was
greatly simplified!
Jeff Guerber
Raytheon ITSS
NASA Goddard Space Flight Center
Oceans and Ice Branch
pro test_drawalign
xs = 300L
ys = 200L
tlb = widget_base(column=1)
;; Upper frame, has long labels.
frameBase1 = widget_base(tlb, row=1, /frame)
labelBase1 = widget_base(frameBase1, /frame, column=1)
label1a = widget_label(labelBase1,value='This is a pretty long label')
label1b = widget_label(labelBase1,value='Here is another long label')
draw1 = widget_draw(frameBase1, /frame, xsize=xs, ysize=ys)
;; Lower frame, has short labels
frameBase2 = widget_base(tlb, row=1, /frame)
labelBase2 = widget_base(frameBase2, /frame, column=1)
label2a = widget_label(labelBase2, value='Short label')
label2b = widget_label(labelBase2, value='Also short')
draw2 = widget_draw(frameBase2, /frame, xsize=xs, ysize=ys)
;; Rest
widget_control, tlb, /realize
widget_control, draw1, get_value=win1
wset, win1
plot,[0,1]
widget_control, draw2, get_value=win2
wset, win2
plot,[1,0]
return
end
|