[wxruby-users] xml.load_panel
Mario Steele
mario at ruby-im.net
Wed Aug 27 03:16:56 EDT 2008
Hello Max,
On Wed, Aug 27, 2008 at 1:07 AM, Max Salov <lists at ruby-forum.com> wrote:
> And one more question regarding events. What happens to events,
> assosiated to destroyed objects?
>
> my_button = Wx::Button.new self
> evt_button my_button, :my_button_click
> my_button.destroy
>
> Is this code ok, or I have to disconnect event first?
>
> my_button = Wx::Button.new self
> evt_button my_button, :my_button_click
> disconnect my_button, Wx::ID_ANY, :evt_button
> my_button.destroy
This part, you don't have to worry about disconnecting any events, as wxRuby
automatically disconnects any associated events from the object, before
destruction. Your first example, would work just fine.
--
Mario Steele
http://www.trilake.net
http://www.ruby-im.net
http://rubyforge.org/projects/wxruby/
http://rubyforge.org/projects/wxride/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/wxruby-users/attachments/20080827/a6406869/attachment.html>
More information about the wxruby-users
mailing list