CW_FORM [message #21332] |
Tue, 22 August 2000 00:00  |
<hom
Messages: 5 Registered: August 2000
|
Junior Member |
|
|
I want to create a widget that will allow the user to input several
strings into various fields, and then have a 'Quit' button that when
pressed will destroy the widget and retain the inputed values.
Below is my code. So far I am unsuccessful at getting CW_FORM to work. Is
CW_FORM what I should be using? If so, could anyone tell me what I am
missing in my code?
I would appreciate any help!!
Thanks,
Aimy
;*********************************************************** *****
pro CmpndWidget
BaseWidget=WIDGET_BASE(Title='Base',/COLUMN)
desc=['1,TEXT,File Name, WIDTH=12, TAG=Name',$
'0, BUTTON, OK, QUIT, TAG=OK', $
'2, BUTTON, Cancel, QUIT']
FormWidget=CW_FORM(BaseWidget,desc,/COLUMN)
; Making the widget visible on the screen
WIDGET_CONTROL, /REALIZE, BaseWidget
REPEAT BEGIN
event=widget_event(BaseWidget)
ENDREP UNTIL (event.quit EQ 1)
print, event.VALUE
end
|
|
|
|
|
|
Re: CW_FORM [message #33033 is a reply to message #21332] |
Wed, 27 November 2002 11:30  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
miki (miki.guglie@virgilio.it) writes:
> I developed a GUI using CW_FORM to build forms with several columns of
> buttons and test fields, but when I tested the software under different OS I
> realized that with some OS the forms built with CW_FORM are not aligned
> (i.e., the third button of the first column is lower than the third text
> field on the second column and the last button is muche lower than the last
> field). How could I fix that?
I think you have two choices for fixing this:
1. Lower your expectations (easiest)
2. Build your own forms by hand (hardest)
RSI's engineers, bless them, are very, very good.
But most of them have never been to art school,
and apparently most engineering departments are
still scrimping on Aesthetics 101. So the chance
that something like alignment would be addressed
in a compound widget from RSI is not as good as
we would like it to be, probably.
And, to be fair, when you try to do something
as ambitious as CW_FORM *AND* you want to make
it cross-platform, the challenges are formidable,
if not impossible to solve.
I always build my own forms because I am...well...
nuts. But even that is not a perfect solution because
every time someone runs the code on a platform other
than mine (and cares enough to report it to me) I end
up tweaking it here and there. Some days it seems an
endless task. :-(
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|