comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » General purpose structure editor?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
General purpose structure editor? [message #14387] Wed, 24 February 1999 00:00 Go to next message
Dyer Lytle is currently offline  Dyer Lytle
Messages: 11
Registered: April 1996
Junior Member
Hi,

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.)

Thanks,

-Dyer

--

-Dyer Lytle in Tucson
Cassini ISS Software Engineer
dyer@lpl.arizona.edu
Re: General purpose structure editor? [message #14431 is a reply to message #14387] Fri, 05 March 1999 00:00 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Michael Asten (masten@mail.earth.monash.edu.au) writes:

> Well well.
>
> Seems its been done. The idl routine XVAREDIT is one of rsi's best
> kept secrets.

I'm sorry. I don't wish to offend anyone here, least of all
RSI. But every program I have ever seen that uses the table
widget (and this includes XVAREDIT) is an abomination.

I just tried it again to be certain that it is not old
prejudices getting in the way of progress. When I run your
example program, for example, all the columns titles are
stacked up on top of one another because the columns don't
size themselves to fit their titles, they size themselves
to fit their contents. Which pretty much means you can't
read the column headers at all.

Ok, I can reach up there with my mouse and interactively
resize the column header so I can read it. But I have to
do this for EVERY friggin column! Now I can read my
columns, so I at least know what I am editing. (Never
mind now that I can't resize the widget, so that the
space I have to work with at this point is about as
wide as a single column. I'll use the helpfully provided
slider bar to quickly locate which of the--what--20 columns
I want to edit.)

So now I select the cell I want to edit. It gets highlighted.
I hit a key to edit it. ..... Nothing.

Must have done something wrong. Read the newsgroup article
again. Humm. "Double click" to edit. Try that. Ok, double
clicking selects the *number* in the cell instead of the
cell. I see. Try to edit that. .... Still nothing. Humm.
This doesn't work like any cell editor I've ever used. Still,
must be a way or they wouldn't put the damn thing out there.

Etc., etc., etc. And so it goes.

I eventually get a damn number to change, but I have no
idea WHY!

And I'm asking myself, "If I were a person writing a program
for someone who was going to pay me for the program, would
I ever, EVER put something like this in it?" And I've got to
tell you, that if anyone ever wrote a program like this for me
and wanted me to pay for it...well, it would be the last program
they ever wrote for me.

I don't know why I'm so crotchety this morning. Posting this
article can't do anything but get me in trouble. But someone
has got to hear the truth about this table widget.

Cheers,

David

--
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
Re: General purpose structure editor? [message #14435 is a reply to message #14387] Fri, 05 March 1999 00:00 Go to previous messageGo to next message
Michael Asten is currently offline  Michael Asten
Messages: 53
Registered: March 1999
Member
David Fanning wrote:

> Dyer Lytle (dyer@lpl.arizona.edu) 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. :-)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.

============
Well well.

Seems its been done. The idl routine XVAREDIT is one of rsi's best
kept secrets.
(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
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

============
Re: General purpose structure editor? [message #14476 is a reply to message #14387] Tue, 02 March 1999 00:00 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
J.D. Smith (jdsmith@astrosun.tn.cornell.edu) writes:

> Gee David, I remember when you used to offer rewards
> for challenges such as this.

These days Dick and I are so busy (working on a book, hooray!)
that the only reward we can offer someone who comes up with
a really good program is a job. :-)

I haven't seem too much code yet. Maybe this project is
harder than we thought...

Cheers,

David

P.S. If you *are* a great IDL programmer and you like to live
life on the edge, crave artistic freedom, like to work in
your pajamas, want an uncertain (but potentially large)
income, etc., then give me a call. We are looking for the
right person. :-)

--
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
Re: General purpose structure editor? [message #14477 is a reply to message #14387] Tue, 02 March 1999 00:00 Go to previous messageGo to next message
J.D. Smith is currently offline  J.D. Smith
Messages: 214
Registered: August 1996
Senior Member
David Fanning wrote:
>
> Christopher C. Lamb (cclamb@sandia.gov) writes:
>
>>> Does anyone know if there exists IDL code anywhere
>>> for a general purpose, widget-based, IDL structure
>>> editor.
>>
>> Don't know of one, but I think it wouldn't be
>> too hard to throw one together using the
>> Execute function.
>
> Yeah, someone could probably knock it out in a half hour. ;-)
>
> Cheers,
>
> David
>
> P.S. Nothing like a little programming challenge to get
> those competitive juices flowing....
>
> --
> 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

Gee David, I remember when you used to offer rewards for challenges such
as this.
--
J.D. Smith |*| WORK: (607) 255-5842
Cornell University Dept. of Astronomy |*| (607) 255-6263
304 Space Sciences Bldg. |*| FAX: (607) 255-5875
Ithaca, NY 14853 |*|
Re: General purpose structure editor? [message #14527 is a reply to message #14387] Thu, 25 February 1999 00:00 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Christopher C. Lamb (cclamb@sandia.gov) writes:

>> Does anyone know if there exists IDL code anywhere
>> for a general purpose, widget-based, IDL structure
>> editor.
>
> Don't know of one, but I think it wouldn't be
> too hard to throw one together using the
> Execute function.

Yeah, someone could probably knock it out in a half hour. ;-)

Cheers,

David

P.S. Nothing like a little programming challenge to get
those competitive juices flowing....

--
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
Re: General purpose structure editor? [message #14541 is a reply to message #14387] Tue, 09 March 1999 00:00 Go to previous message
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
David Fanning wrote:
>
> Michael Asten (masten@mail.earth.monash.edu.au) writes:
>
>> Well well.
>>
>> Seems its been done. The idl routine XVAREDIT is one of rsi's best
>> kept secrets.
>
> I'm sorry. I don't wish to offend anyone here, least of all
> RSI. But every program I have ever seen that uses the table
> widget (and this includes XVAREDIT) is an abomination.
>
<big-time snip of David being cranky>
>
> I don't know why I'm so crotchety this morning. Posting this
> article can't do anything but get me in trouble. But someone
> has got to hear the truth about this table widget.
>
> Cheers,
>
> David

David -

I'm glad someone finally said it! I used WIDGET_TABLE() once,
hated it, and swore never to use it again. Our users use
Excel, and expect to find similar behavior in a cell editor.
I would be too embarrassed to put that thing in ANY of my programs!

Dave
--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
Re: General purpose structure editor? [message #14570 is a reply to message #14387] Mon, 08 March 1999 00:00 Go to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
David Fanning wrote:
>
> MIchael Asten (MichaelAsten@Flagstaff-GeoConsultants.com.au) writes:
>
>> I agree with your grumps re idl 5.x XVAREDIT as being non-intuituive. I
>> actually logged a bug report with rsi when I first tried it, and found it
>> " didnt work"; silly me I didnt think of double clicking etc etc.
> [...]

There seems to be another bug in XVAREDIT (at least for IDL 5.1): I have
a structure
IDL> help,minfo,/stru
** Structure CTMMT, 11 tags, length=48:
NAME STRING 'GEOS1'
FAMILY STRING 'GEOS'
ONLINE INT 0
NLAYERS INT 20
NTROP INT 14
PTOP FLOAT 10.0000
PSURF FLOAT 986.000
RESOLUTION FLOAT Array[2]
HALFPOLAR INT 1
CENTER180 INT 1
FULLCHEM INT 1

and if I call XVAREDIT,minfo I get all the fields in the structure, but
at the end a thousand (well, almost;-) repetitions of the var.FAMILY
entry. And, David, you are absolutely right about your opinion on the
table widget - except that I do find it useful for simple display
purposes when you don't want anyone to mess around with the data you are
showing.

Martin.


> You are not alone. RSI themselves couldn't figure it out
> when they wrote the ASCII_TEMPLATE program.
This sounds almost like some other company in Wash.?

> I'm sure I've mentioned that I LOVE
> IDL at least a couple of times in the past week.
Just this past week, I had to admit to a colleague several times that
IDL does have some limitations and some strange behaviour. Of course,
for David it is nice that people have to know about IDL's idiosyncrazies
but for many others it often means unnecessary frustration. Below three
of the major complaints that I heard last week:

* logarithmic plots: why isn't there an easier way to plot "sensible"
labels except using xyouts? Since the [XYZ]TICKS keyword doesn't make
too much sense in a log plot anyway, one possibility could be to
redefine it as follows:
ticks = 0 : default, labeling only at decades
1 : labels at 1, 2, 5, 10, 20, 50, 100, ...
2 : labels at 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,...
and even(?) 3 : labels at 1, 1.2, 1.5, 2., 2.2, 2.5, 3, ...
I bet there are thousands of IDL users who have been frustrated about
this missing feature at least once!

* map_set etc.: for the default projection, if you use limits=[..]
you need to make sure that your lon0 parameter lies within your range.
But don't touch lat0 ! This is one of those unexpected side effects that
may take a while to figure out for not so experienced users.

* colors: for users who want to use IDL simply to do their data
analysis and who produce mostly line plots, it would certainly be
helpful to have predefined drawing colors as default (instead of or in
addition to) the grey scale color table which first has to be
overwritten (and this seems to be a running themke on this newsgroup
too). Best would be to have a standard set of named colors so that you
could write plot,color=black and it would work no matter whether you
have < 256 colors or 16M. This shouldn't be hard to implement for true
color systems, and for color table users, one could perhaps reserve a
few entries for these drawing colors as default and leave them intact if
someone issues a loadct, except if he/she explicitely sets bottom to
zero.
Also, plot, color=red should as default plot only the data in red but
use a "systemwide" default color for the axis. Don't ask how many times
I wrote
plot,dummy,/nodata,...
oplot,data,color=red,...



But, yes, even I love IDL - otherwise I wouldn't spend so much time
trying to solve my colleagues' problems and reading and writing on this
newsgroup.

Martin.


------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Engineering&Applied Sciences, Harvard University
109 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA

phone: (617)-496-8318
fax : (617)-495-4551

e-mail: mgs@io.harvard.edu
Internet-homepage: http://www-as.harvard.edu/people/staff/mgs/
------------------------------------------------------------ -------
Re: General purpose structure editor? [message #14575 is a reply to message #14387] Sat, 06 March 1999 00:00 Go to previous message
mallors is currently offline  mallors
Messages: 76
Registered: November 1997
Member
In article <36DF84A4.1F6575D7@mail.earth.monash.edu.au>,
Michael Asten <masten@mail.earth.monash.edu.au> writes:

> Well well.
>
> Seems its been done. The idl routine XVAREDIT is one of rsi's best
> kept secrets.
> (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.


I wrote a companion routine called XVarExport which will
(well, should :-) allow you to interactively select and export
any variables to an IDL save file. It could be a little memory
intensive for large datasets, since it must copy your data
to local variables prior to the SAVE, but I couldn't see any
other way to do it.

For more info, see

http://cspar.uah.edu/~mallozzir/software/idl/idl.html


-bob mallozzi




--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
Robert S. Mallozzi 256-544-0887
Mail Code ES 84
Work: http://www.batse.msfc.nasa.gov/ Marshall Space Flight Center
Play: http://cspar.uah.edu/~mallozzir/ Huntsville, AL 35812
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
Re: General purpose structure editor? [message #14576 is a reply to message #14387] Sat, 06 March 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
MIchael Asten (MichaelAsten@Flagstaff-GeoConsultants.com.au) writes:

> I agree with your grumps re idl 5.x XVAREDIT as being non-intuituive. I
> actually logged a bug report with rsi when I first tried it, and found it
> " didnt work"; silly me I didnt think of double clicking etc etc.

You are not alone. RSI themselves couldn't figure it out
when they wrote the ASCII_TEMPLATE program. There they
added a text widget that you type into, and *that*
edits the table widget. Easier to edit the table widget
in this roundabout, non-intuitive way than to memorize
the particular magical incantations normally required,
I guess.

But--in any case--I'm sure I've mentioned that I LOVE
IDL at least a couple of times in the past week. And
I do. I'm just not overly fond of the table widget. :-)

Cheers,

David

--
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: autocorrelation routine...
Next Topic: IDL reader for medical images

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:36:22 PDT 2025

Total time taken to generate the page: 0.00465 seconds