[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: widget_table

Brian Reardon (reardonb@my-deja.com) writes:

> I find it hard to believe that no one as been in my situation. Perhaps I
> need to explain the problem a bit more.  Let's say that I am writing an
> IDL program called X_Optimizer that
> optimizes a vector of parameters (Test_Params) that are sent to a user
> defined function called FX and FX returns a vector of data called
> Calc_Data that is then compared to a vector of experimental data call
> Exp_data.  Based on how that comparison goes, X_optimizer adjusts
> Test_Params accordingly and then calls FX again.  Now, let's say that
> each element of Test_Params is somehow selected from a user defined
> range of possible values.  In otherwords, in X_Optimizer, there is a
> widget that allows the user to enter in how many variables are used by
> FX and what the upper and lower bounds on those variables are allowed to
> be.  Thus, I need a widget that allows the user to input:
> 1) the number of variables that will be optimized,
> and then in (some sort of) table form:
> 2) a vector that holds the names of each variable (Temperature,
> pressure, IQ, etc)
> 3) a vector that holds the lower bounds of each variable (0., 0., 80.,
> etc)
> 4) a vector that holds the upper bounds of each variable (1000., 100.,
> 140., etc.)
> 5) a vector that holds a measure of the resolution that is needed for
> each variable(1.0,0.1,1.0, etc)
> What is the best way to go about doing this if widget_table is not to be
> used?

I really don't know about the "best way". There are all
kinds of ways to organize your graphical user interface.
I'm just saying that for me personally the table widget
option is usually far down the list of possibilities.
So far down, in fact, that I have never yet had to
implement one. But, as Pavel points out, it may be
just the thing for you. You shouldn't let my personal
taste in graphical user interface elements get in the
way of your design decisions. :-)

I will say, however, that when I am thinking
about bounding the value of a variable that one of the
first things that pops into my head is a slider widget,
since I think (depending upon the application, of course)
that this gives better feedback to the user and allows
more freedom to "play" with the data. It also cuts down
on a lot of the error checking I would have to do if
I allowed the user to "type" a value.

In your case, I would think, probably, of creating a
pop-up modal dialog that described the user's choices
and offered a number of different kinds of widgets to
express the user's wishes. It's hard for me to say,
exactly, what that would look like without knowing more
about the problem. But I'm pretty sure my implementation
of the solution would not have a table widget. :-)



David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155