Re: widget_base alignment question [message #42723 is a reply to message #42639] |
Mon, 21 February 2005 13:35  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
JD Smith writes:
> Useful layout trick. Does this work for everyone? Why does Linux
> suffer here?
Suffer!? You don't even want to know! I made the mistake
of making my Catalyst test application available. It is
a nightmare. Private discussions lead me to conclude even
RSI is not immune to the problems caused by differences
in graphical user interface implementations.
> Unless I realize the widgets first, and set the xsize
> after, the labels are piled up on each other (see
> turtle.as.arizona.edu/idl/test_pre.png and
> turtle.as.arizona.edu/idl/test_fix.png). But even that doesn't really
> fix it, cutting off part of the "t" in "right".
I think this might be because your draw widget is probably
slightly bigger than you think it is. In Windows, anyway,
there is a 3 pixel "border" around the canvas of a draw
widget, and this has to be accounted for if things are to
align themselves. I offer my test program as an example that
ran OK in Windows.
;*********************************************************** **********
Pro TEST_EVENT, event
Widget_control, event.top, Get_UValue=info
Print, event.x, event.y
Widget_Control, info.labelbase, XSIZe=event.x-6
Widget_Control, info.draw, XSIZe=event.x
END
PRO TEST
tlb = Widget_base(column=1, /TLB_SIze_Events)
base = widget_base(tlb, Row=1)
labelbase = Widget_Base(base, Column=2, /Grid, xsize=194)
button = Widget_Label(labelbase, Value='Align Left', align_left=1)
button = Widget_Label(labelbase, Value='Align Right', align_right=1)
draw = widget_Draw(tlb, xsize=200, ysize=100)
Widget_Control, tlb, /Realize, Set_UValue={labelbase:labelbase,
draw:draw}
Xmanager, 'test', tlb, /No_Block
END
;*********************************************************** **********
> Then when it gets resized, and a TLB_SIZE_EVENTS comes in, it is clearly
> lying about the "frame-free" size of the usable window area, and the
> widgets are resized to overfill the window (see
> turtle.as.arizona.edu/idl/test_post.png). Does anyone at RSI actually go
> through the layout on all of their systems to see what works?
I presume you are asking a rhetorical question here. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|