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.
Subject: [ruby-gnome2-devel-en] Gtk Notebook “change-current-page”
doesn’t work
Date: sab 16 feb 13 07:36:44 +0100
Quoting Ebru A. ([email protected]):
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.html#GtkNotebook-switch-page
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 - [email protected] che bisogno ci
sarebbe-
di parlare tanto di amore e di rettitudine?
-
(Chuang-Tzu)
I couldn’t get exactly. Namely how can i get selected page number?
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 A. ([email protected]):
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 - [email protected] che bisogno ci
sarebbe-
di parlare tanto di amore e di rettitudine?
-
(Chuang-Tzu)
Ok, thank you for your help