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

Home » Public Forums » archive » Re: Error in the spinner control panel on Catalyst library
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Error in the spinner control panel on Catalyst library [message #64175 is a reply to message #64174] Tue, 09 December 2008 15:46 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Giorgio writes:

> I am using the spinners of the catalyst library. I call the control
> panel of the spinner and when I click in either of the lower buttons:
> cancel, apply or ok, I have an error telling that there is no select
> in the event structure returned:
>
> % Tag name SELECT is undefined for structure CATCONTROL_PANEL.
> % Execution halted at: SPINNER::EVENTHANDLER 237 H:\IDLWorkspace
> \catalyst\catalyst\source\widgets\spinner__define.pro
> % CATCONTROLPANEL::EVENTHANDLER 179 H:
> \IDLWorkspace\catalyst\catalyst\source\core
> \catcontrolpanel__define.pro
> % CATEVENTDISPATCHER 175 H:\IDLWorkspace
> \catalyst\catalyst\source\utilities\cateventdispatcher.pro
> % $MAIN$
>
> I see that the event_handler to the method ControlPanel_Events on the
> spinner object. Could this be the problem?

Well, this is an interesting little problem. :-)

When Dave Burridge and I were building the Catalyst Library, we
used to argue incessantly over little things. Normally, one of
us would convince the other in an hour or so of the correctness
of our argument, and we would move on. But, occasionally, we
would have to agree to disagree.

Those OK, APPLY, and CANCEL buttons on ControlPanels were one
of those things. Dave wanted them. I hated them and found them
annoying. We spent at least a week arguing about it, and in the
end we decided to leave them in, but have the ability to turn
them off via keywords. The truth is, I *always* turn them off
when I write ControlPanel methods (although I forgot to do so
this time) and so I occasionally forget to code for them.

So, there are two ways of solving this problem. The way I would
solve it is to set the keywords /NO_OK, /NO_APPLY, and /NO_CANCEL
in the spinner ControlPanel method on the line (112 in my copy)
that creates the spinner control panel. Then, you won't have those
buttons to worry about.

Dave's way of solving this (probably), would be to add cases for
the buttons in the EventHandler method. So right after the code
that is handling SPINNER_TEXTWIDGET events (lines 214-232 in my
copy), I would add the following three lines before the ELSE clause
in the CASE statement:

'OK': self -> SendEvent

'APPLY': self -> SendEvent

'CANCEL': self -> SendEvent

This is your choice, I guess. But I think I am going to go
with the first solution in the official code, unless you
come up with some more convincing argument about why you
need it otherwise. :-)

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.")
[Message index]
 
Read Message
Read Message
Previous Topic: Error in the spinner control panel on Catalyst library
Next Topic: Re: Anyone can explain this?

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

Current Time: Sat Oct 11 15:57:24 PDT 2025

Total time taken to generate the page: 1.84198 seconds