Cancel an event

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?

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs