Cancel an event


#1

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?


#2

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