Forum: FXRuby Cancel an event

6256f6891b1eeea6413acb78975f2f17?d=identicon&s=25 tuti plain (tutiplain)
on 2009-12-16 04:06
Hi all,

  I want to do something like this:

button.connect(SEL_COMMAND) do

... some code...
if some_condition then "cancel this event"

end

  What I want is, a way to get out of the event's code, without
terminating the program.  How do I do this?
95c7086804620edee39f58228f70c4c1?d=identicon&s=25 Philip Stephens (philipcs)
on 2010-01-01 19:20
tuti plain wrote:
> Hi all,
>
>   I want to do something like this:
>
> button.connect(SEL_COMMAND) do
>
> ... some code...
> if some_condition then "cancel this event"
>
> end
>
>   What I want is, a way to get out of the event's code, without
> terminating the program.  How do I do this?

Have you tried:

... some code ...
if some_condition then return end

Happy New Year
This topic is locked and can not be replied to.