I'm still a bit new to Ruby, but have been using WxRuby for a couple of months now. I've created a notebook with a few pages, and am having a tough time understanding how to implement an event handler that would get called whenever the page gets changed. Would someone be kind enough to post a simple example?
on 2012-05-16 22:18
on 2012-05-17 11:23
hi On 16/05/12 21:18, Norbert Lange wrote: > I'm still a bit new to Ruby, but have been using WxRuby for a couple of > months now. I've created a notebook with a few pages, and am having a > tough time understanding how to implement an event handler that would > get called whenever the page gets changed. Welcome to wxRuby. There are two events : evt_notebook_changing and evt_notebook_changed. They receive a Wx::NotebookEvent, and the former can be veto-ed if you want to prevent the change. There's an example within the bigdemo sample: http://wxruby.rubyforge.org/svn/trunk/wxruby/sampl... alex
on 2012-05-17 17:28
Alex Fenton wrote in post #1061104: > hi > > On 16/05/12 21:18, Norbert Lange wrote: >> I'm still a bit new to Ruby, but have been using WxRuby for a couple of >> months now. I've created a notebook with a few pages, and am having a >> tough time understanding how to implement an event handler that would >> get called whenever the page gets changed. > > Welcome to wxRuby. There are two events : evt_notebook_changing and > evt_notebook_changed. They receive a Wx::NotebookEvent, and the former > can be veto-ed if you want to prevent the change. > > There's an example within the bigdemo sample: > http://wxruby.rubyforge.org/svn/trunk/wxruby/sampl... > > alex Thanks Alex. That's exactly what I was looking for. Norbert
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.