[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: General purpose structure editor?
- Subject: Re: General purpose structure editor?
- From: Michael Asten <masten(at)mail.earth.monash.edu.au>
- Date: Fri, 05 Mar 1999 18:15:49 +1100
- Distribution: world
- Newsgroups: comp.lang.idl-pvwave
- Organization: Monash Uni
- References: <36D45EEB.A6778B0F@lpl.arizona.edu> <MPG.email@example.com>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:13838
David Fanning wrote:
> Dyer Lytle (firstname.lastname@example.org) writes:
> > Does anyone know if there exists IDL code anywhere
> > for a general purpose, widget-based, IDL structure
> > editor that will display the tags and values in
> > a text field and allow the user to edit them and
> > save back to the structure? It should also descend
> > into arrays and pointers to substructures, etc.
> > (I am trying to avoid writing this myself although
> > it will be an interesting project.)
> Here's a piece of advice, Dyer. Do this on your
> own time with the PC at home and don't touch the
> University's computers. Then, when you have it done,
> call me first before you show it to anyone else.
> I've got a feeling you are not the only one who
> wants one of these. :-)
> David Fanning, Ph.D.
Seems its been done. The idl routine XVAREDIT is one of rsi's best
(See my comments of Jan 15th on why rsi needs to make a greater effort
on developing library widgets for its users, and make a greater effort
to provide documentation guidance and examples of their use).
I prefer XVAREDIT from idl 4.0, but be warned, rsi techs say it has a
reported bug (altho I havnt found it).
XVARDEDIT from idl5.x is a totally rewritten routine, which to me gives
a widget which is less pleasing to the eye, and clunky to use (needs
press Enter to make an edittable field active, and press Enter to
confirm the editted field, wheras the old version is just like a
wordprocessor to use when editting fields.
Both routines work on structures, including structures containing
arrays. Pointers - I dont think so but check the doc.
The following code illustrates useage.
; 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
; 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
; 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.
xmin=0 & xmax=(5*360) & ymin=-1. & ymax=1.
; now set up a structure to pass plot parameters to an edit widget
xvaredit,plot_par ; edit the parameters in a widget
title=plot_par.plot_title ; now extract the editted parameters
from the structure
print,title,xmin,xmax,ymin,ymax ; print the new values
plot,x,y,title=title,xrange=[xmin,xmax],yrange=[ymin,ymax] ; draw the