# Gtk Notebook "change-current-page" doesn't work

**URL:** <https://www.ruby-forum.com/t/gtk-notebook-change-current-page-doesnt-work/226637>\
**Category:** Ruby-Gnome 2\
**Created:** [February 16, 2013, 7:36am UTC](https://www.ruby-forum.com/t/gtk-notebook-change-current-page-doesnt-work/226637 "2013-02-16T07:36:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebruakagunduz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ea666f/32.png) [@ebruakagunduz](https://www.ruby-forum.com/u/ebruakagunduz)\
**Post date:** [February 16, 2013, 7:36am UTC](https://www.ruby-forum.com/t/gtk-notebook-change-current-page-doesnt-work/226637/1 "2013-02-16T07:36:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ebruakagunduz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ea666f/32.png) [@ebruakagunduz](https://www.ruby-forum.com/u/ebruakagunduz)\
**Post date:** [February 16, 2013, 8:46am UTC](https://www.ruby-forum.com/t/gtk-notebook-change-current-page-doesnt-work/226637/2 "2013-02-16T08:46:17Z")

</div>

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. ([removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)):

> 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](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 - [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) che bisogno ci  
sarebbe
  - 

```
          di parlare tanto di amore e di rettitudine? 

```

(Chuang-Tzu)

---

<div class="post-metadata">

**Author:** ![ebruakagunduz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ea666f/32.png) [@ebruakagunduz](https://www.ruby-forum.com/u/ebruakagunduz)\
**Post date:** [February 16, 2013, 8:53am UTC](https://www.ruby-forum.com/t/gtk-notebook-change-current-page-doesnt-work/226637/3 "2013-02-16T08:53:47Z")

</div>

I couldn’t get exactly. Namely how can i get selected page number?

---

<div class="post-metadata">

**Author:** ![ebruakagunduz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ea666f/32.png) [@ebruakagunduz](https://www.ruby-forum.com/u/ebruakagunduz)\
**Post date:** [February 16, 2013, 10:19am UTC](https://www.ruby-forum.com/t/gtk-notebook-change-current-page-doesnt-work/226637/4 "2013-02-16T10:19:12Z")

</div>

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. ([removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)):

> 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 - [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) che bisogno ci  
sarebbe
  - 

```
          di parlare tanto di amore e di rettitudine? 

```

(Chuang-Tzu)

---

<div class="post-metadata">

**Author:** ![ebruakagunduz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ea666f/32.png) [@ebruakagunduz](https://www.ruby-forum.com/u/ebruakagunduz)\
**Post date:** [February 16, 2013, 2:44pm UTC](https://www.ruby-forum.com/t/gtk-notebook-change-current-page-doesnt-work/226637/5 "2013-02-16T14:44:39Z")

</div>

Ok, thank you for your help 🙂
