[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Thoughts on IDL5.2 GuiBuilder and library widgets
- Subject: Thoughts on IDL5.2 GuiBuilder and library widgets
- From: Michael W Asten <masten(at)earth.monash.edu.au>
- Date: Fri, 15 Jan 1999 16:26:27 +1100
- Distribution: world
- Newsgroups: comp.lang.idl-pvwave
- Organization: Monash Uni
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:13338
Thought I might share a few comments on idl libray guis, and on the idl
5.2 GuiBuilder.
I have passsed these comments on to RSI, and had some useful feedback.
As far as my requests go, they have been added to the RSI customer
request list; maybe if other users see
similar needs and write in to rsi, then the requests will be
correspondingly higher
on the priority list. I should add the caveat that i speak as a
scientific user of idl, not as a programmer,
so my perspective will probably be naive to the expert users.
The GuiBuilder: (a bouquet) It is an excellent interface, very easy to
use after
getting the hang of it. It does need more documentation at even
simpler level
than that in the online doc provided .
In particular, the base widget has a pull-down menu capability, which
can be used
to build a program "launcher" with great ease.
The IDL5.2 guibuilder is also great for building labels, and buttons,
and the
necessary program links.
(a brickbat): the present version of the GuiBuilder cant build complex
widgets;
this means building a set of fields to get mixed integers, real numbers
and strings into and out
of a widget is difficult. In fact I cant for the life
of me make use or
sense of the GuiBuilder "text widget"; the amount of programming needed
to catch the various
delete/insert/singleChar/multipleChar options seems
pointless when the ancient (and much maligned) WIDED (from idl 4.x) can
build
a compound-widget gui for fields quickly (altho clumsily).
A useful trick to get a set of fields into a gui for editting/selection,
is to use
the XVAREDIT routine. If (say) we want to enter a title (string) and
four axis limits (reals)
for a plot, then an instant gui for entering/editting those parameters
can be obtained by passing all the parameters to XVAREDIT as a
structure; XVAREDIT
allows each element of a structure to be ediited in a field separately,
and the structure tags
provide prompts to the user (example code appended below).
I prefer the obsolete version of XVAREDIT from idl4.x, but the idl5.x
version also works
(but be warned) needs double clicks to open cells for editing, and the
Enter key to'accept'
an editted value.
This opens another issue I have found; IDL has a few very powerful
library widgets,
dialog_pickfile, dialog_message, xdisplayfile, xvaredit) but the on-line
documentation says virtually
nothing about them in general chapters, so a new user can be completely
ignorant
of the friendly features that can get a program up and running quickly,
without widget programming needed. It would be useful to add an online
chapter on
" Hints for getting the best out of library guis". The most obviously
"missing" libary
widget is a generalised version of xvaredit which might allow calls in
the form
xvaredit, var, list=list,prompt=prompt
where var is an array (strings, int or reals),
list is an array of same length of strings used as labels alongside
each element of var,
and prompt is a title/directive explaining what the selections are for.
A couple of other widgets which I suggest should be in a core library
are a
1) color bar for direct graphics
images (its an FAQ I know, and the Coyote has one on his website, but
why isnt such an
obvious item included by arrangement with the idl distribution?)
2) a ' fuel-gauge' widget to show progress within a slowly executing
loop (call un update
to the fuel gauge at each loop commencement). Everyone will have their
own favorite
"indispensables".
Regards,
Michael Asten
masten@earth.monash.edu.au
;==============================
; program to demonstrate use of XVAREDIT for editting mixed string and
; real numbers, in a widget
; this works in idl 5.x, but note the edit process on each cell of the
widget
; requires a double click to "activate" the cell, and a Press Enter
; to confirm changes to the cell.
; This program works more cleanly and more intuitively with the
different
; procedure (of the same name) XVAREDIT in IDL 4.x
; (in directory \rsi\idl40\lib).
;
; demo by Michael Asten, Monash University, Melbourne. 9 Jan 99.
;
x=10.*indgen(5*36)
y=sin(x*!pi/180)
plot,x,y
xmin=0 & xmax=(5*360) & ymin=-1. & ymax=1.
title='XVAR TEST'
print,title,xmin,xmax,ymin,ymax
; now set up a structure to pass plot parameters to an edit widget
plot_par={plot_title:title,Xaxis_left_limit:xmin,Xaxis_right_limit:xmax,
$
Yaxis_lower_limit:ymin,Yaxis_top_limit:ymax}
xvaredit,plot_par ; edit the parameters in a widget
title=plot_par.plot_title ; now extract the editted parameters
from the structure
xmin=plot_par.Xaxis_left_limit
xmax=plot_par.Xaxis_right_limit
ymin=plot_par.Yaxis_lower_limit
ymax=plot_par.Yaxis_top_limit
print,title,xmin,xmax,ymin,ymax ; print the new values
plot,x,y,title=title,xrange=[xmin,xmax],yrange=[ymin,ymax] ; draw the
new plot
end
; =============================