Forum: Ruby-Gnome 2 Gtk Notebook "change-current-page" doesn't work

Ff312ec21b0fd1d07c8708e29df7d242?d=identicon&s=25 Ebru Akagunduz (ebruakagunduz)
on 2013-02-16 07:36
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.
3853dd5371ac1e094fc45d6c2aa0e459?d=identicon&s=25 Carlo E. Prelz (Guest)
on 2013-02-16 08:46
(Received via mailing list)
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)
Ff312ec21b0fd1d07c8708e29df7d242?d=identicon&s=25 Ebru Akagunduz (ebruakagunduz)
on 2013-02-16 08:53
I couldn't get exactly. Namely how can i get selected page number?
3853dd5371ac1e094fc45d6c2aa0e459?d=identicon&s=25 Carlo E. Prelz (Guest)
on 2013-02-16 10:19
(Received via mailing list)
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)
Ff312ec21b0fd1d07c8708e29df7d242?d=identicon&s=25 Ebru Akagunduz (ebruakagunduz)
on 2013-02-16 14:44
Ok, thank you for your help :)
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.