[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Switch to last page in Gtk::Notebook

Dario Linsky

9/15/2003 11:07:00 PM

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
2 Answers

Frank Schmitt

9/23/2003 12:21:00 PM

0

Dario Linsky <news@silverstripe.de> writes:

> 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

--
Frank Schmitt
4SC AG phone: +49 89 700763-0
e-mail: frankNO DOT SPAMschmitt AT 4sc DOT com

Masao Mutoh

9/23/2003 1:45:00 PM

0

Hi,

On Tue, 23 Sep 2003 21:33:34 +0900
Frank Schmitt <invalid@seesignature.info> wrote:

> Dario Linsky <news@silverstripe.de> writes:
>
> > 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.

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

Thanks for reporting.
Masao.

--
.:% Masao Mutoh<mutoh@highway.ne.jp>