PropertySheet Widget Question [message #36398] |
Thu, 11 September 2003 20:56 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Hi Folks,
I've spent a very pleasant day immersed in the PropertySheet
widget. I can see now why Rob Dimeo was asking about a way
to dynamically resize the buggers. Unless you plan to write
the names of properties in code (the ol' 8.3 file naming
convention comes to mind) the default sizing is, uh, not
entirely helpful. I'm sure the Mac guys will be having fits.
The other thing I have noticed about them is that they
are not known for their cogent error messages. They are
very simple to create:
ps = Widget_PropertySheet(parentID, Value=anObject)
Where "anObject" is the object that you have registered
properties with. But, apparently, the property sheet code
does all manner of checking of the properties that are
registered, because you can get all kinds of errors from
that single line.
Here are two I've gotten today:
%WIDGET_PROPERTYSHEET: Expression must be a scalar or
1 element array in this context <STRING Array(10>
Unable to convert variable from type object reference.
Both errors point to the same simple line above!
What I learned (eventually) was that this was a problem
with a couple of the properties I registered. But since I had
registered several handful, I had to check them one by one
to find the culprits. (It is especially tedious when you
don't have any great faith that what you are doing might
actually result in your discovering what the problem
might be. And it is odd to be checking code that is
probably separated by several thousands of lines of
code from where the problem is said to have occurred!)
I'd like to request from the good folks at RSI that their
error handler at least identify what property identifier
they think they are working with when things go bad. It would
save several hours of work, at least.
But, I'm not here to complain. I have a question. :-)
I want to set the font type. I have three choices:
Hershey, Hardware, and True-Type. I've used an
enumerated property:
self->RegisterProperty, 'FONT', 9, NAME="Font Type", $
ENUMLIST=['Hershey', 'Hardware', 'True-Type']
But on the property sheet, the list shows up blank
initially. The three choices are there. And it works
correctly, but I just don't see the initial selection.
I see the initial selection appears on iTools enumerated
lists, so I know it is possible. But two hours of looking
hasn't been of much help. Does anyone know how to do this?
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|