Hi, i am using gtk notebook. I need to if user change current page, some button should be active. But current-page-change doesn't work, so nothing happens. I tried "switch-page" signal but it gives me previous page number when i asked "notebook.page". But i need to if user change current page, i should know which page is selected.
on 2013-02-16 07:36
on 2013-02-16 08:46
Subject: [ruby-gnome2-devel-en] Gtk Notebook "change-current-page" doesn't work Date: sab 16 feb 13 07:36:44 +0100 Quoting Ebru Akagunduz (ruby-forum-incoming@andreas-s.net): > Hi, i am using gtk notebook. I need to if user change current page, some > button should be active. But current-page-change doesn't work, so > nothing happens. I tried "switch-page" signal but it gives me previous > page number when i asked "notebook.page". But i need to if user change > current page, i should know which page is selected. Look at the doc page: http://developer.gnome.org/gtk2/2.24/GtkNotebook.h... When you intercept "switch-page", you are returned the new page as second parameter, and the progressive number of the new page as third parameter. Carlo -- * Se la Strada e la sua Virtu' non fossero state messe da parte, * K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)
on 2013-02-16 10:19
Subject: Re: [ruby-gnome2-devel-en] Gtk Notebook "change-current-page"
doesn't work
Date: sab 16 feb 13 08:53:47 +0100
Quoting Ebru Akagunduz (ruby-forum-incoming@andreas-s.net):
> I couldn't get exactly. Namely how can i get selected page number?
If nb is your notebook, you write
nb.signal_connect("switch_page") do |a,b,c|
...
end
b is the newly selected page, and and c is the progressive number of
the newly selected page.
Carlo
--
* Se la Strada e la sua Virtu' non fossero state messe da
parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci
sarebbe
* di parlare tanto di amore e di rettitudine?
(Chuang-Tzu)
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.