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

Re: widget_table

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

> The following code (compliments to David Fanning) is intended to
> generate two tables.  

Now, hold on there, Brian. I didn't write this code.
Nor did I ever (to my recollection) recommend that you 
write it. If word got out that I was recommending the
Table Widget my reputation and credibility would be shot. :-(

> The first is a column lable for the second which
> is to be edited by the user.  The problem is that when I run this code
> on my Mac with IDL 5.3 there is what appears to be an extra column and
> row on the right and bottom of each table.  Adding /scroll does not
> cover this space up. In fact, it makes it worse.  What causes this extra
> space and how can I get rid of it.

I don't know what causes it. I don't think you can
get rid of it. I've heard of it before, but I dislike
the Table Widget so much I don't even want the correspondence
about it polluting my directory structure, so I don't even
have a record of what has been said about it. 

> Also, a search on this newsgroup indicates that everyone hates
> widget_table.  

Really!? How can that be? I'm sure it doesn't have anything
to do with the way the damn thing works. :-)

> How can I accomplish the same thing without using
> widget_table?

Well, I haven't really had need for a table widget before
(thank Goodness!), but if I needed a decent table widget 
here is what I would do.

1. I'd write a Cell object, which would be a text widget
smart enough to know if it was editable or not, whether
it contained a number or string, whether it should always
be positive, etc. I'd probably steal a great deal of code
out of my FSC_InputField object to write this object.

2. Then I would write a Table object that was an array
or grid of these Cell objects. It would have the ability
to tell Cell objects what to do. For example: resize
yourselves, change all your values to 0, reorganize
yourself from a 6x2 grid to a 2x6 grid, tell me what your
current value is, etc. Whatever it was that would be 
required for my particular application.

3. I'd offer it for sale for one month. Then, when I
realized how futile it was to get somebody to pay me
for it, I'd offer it for free on my web page and hope
someone would by the book I wrote to describe how
the free software works.

That's what I would do. :-)



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