Switch to last page in Gtk::Notebook

D

Dario Linsky

Hi everybody,

according to the file containing the Ruby/Gnome2 API reference for
Gtk::Notebook I found the following method description:

--- page=(page_num)
Switches to the page number page_num.
* page_num: index of the page to switch to, starting from 0. If
negative, the last page will be used. If greater than the number of
pages in the notebook, nothing will be done.
* Returns: page_num

So I should be able to switch to the last page using a negative value -
like e.g. -1. To do so I was using the following code:

@notebook.page = -1

Unfortunately this does not work at all, nothing happens. Is somebody
able to reproduce that or is a value like -1 no longer a negative value?
I am currently using another way to bypass the problem but I'd like to
use this more simple version.
Maybe anyone knows about this problem and can tell me if this is only in
Ruby/Gtk or deeper in the core of Gtk2...

Regards, Dario
 
F

Frank Schmitt

Dario Linsky said:
Hi everybody,

according to the file containing the Ruby/Gnome2 API reference for
Gtk::Notebook I found the following method description:

--- page=(page_num)
Switches to the page number page_num.
* page_num: index of the page to switch to, starting from 0. If
negative, the last page will be used. If greater than the number of
pages in the notebook, nothing will be done.
* Returns: page_num

So I should be able to switch to the last page using a negative value -
like e.g. -1. To do so I was using the following code:

@notebook.page = -1

Unfortunately this does not work at all, nothing happens. Is somebody
able to reproduce that or is a value like -1 no longer a negative value?
I am currently using another way to bypass the problem but I'd like to
use this more simple version.
Maybe anyone knows about this problem and can tell me if this is only in
Ruby/Gtk or deeper in the core of Gtk2...

Can't tell you about Gtk2, but with Gtk, the following works:

@notebook.set_page (-1)

HTH & kind regards
frank
 
M

Masao Mutoh

Hi,


This is a bug of Gtk::Notebook#page=. I'll fix it.

Thanks for reporting.
Masao.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,129
Messages
2,570,770
Members
47,329
Latest member
FidelRauch

Latest Threads

Top