Re: compound widgets, widget_control, and keywords [message #56040] |
Fri, 28 September 2007 21:51 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Ken Mankoff writes:
> I'm trying to make a compound widget replacement for the
> widget_slider. I'd like it to be a drop-in replacement, meaning it can
> be used with no code changes (other than instantiation). The problem
> is that WIDGET_CONTROL and WIDGET_INFO accepts keywords that I cannot
> seem to access in my CW.
>
> For example, this line of code:
>
> minmax = WIDGET_INFO(wSlider, /SLIDER_MIN_MAX)
>
> Is there a way to access these keywords through my EVENT_FUNC,
> FUNC_GET_VALUE, or PRO_SET_VALUE defined access points? Or do I have
> to modify the code that is supposed to use this replacement widget?
There is no way to access this functionality, so you will
have to modify your code. Since you are going to the trouble,
though, I suggest you think about writing your compound
widget as an object (perhaps with a function wrapper so
you don't totally shock your users). The advantage of this
is that you can easily access WIDGET_CONTROL and WIDGET_INFO
functionality and information through GETPROPERTY and
SETPROPERTY methods, which seems totally natural for objects.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|