Re: [gtk-list] Re: changing default notebook page title



Owen, gtk_notebook_set_tab_label_text() works just fine.  But why does my code
create a tab, if no tab is created by gtk_notebook_new()?

Thanks,
Aaron

Owen Taylor wrote:

> Daniel Hops <Daniel.Hops@eed.ericsson.se> writes:
>
> > Aaron Walker wrote:
> >
> > > By default, the tab label for the first tab created by
> > > gtk_notebook_new() is set to "Page 1".  Is there any way to change it,
> > > besides removing that tab and then adding a new one with
> > > gtk_notebook_append_page()?
> >
> > Hi,
> >
> > what about this:
> >
> > void
> > set_notebook_tab    (GtkWidget       *notebook,
> >                                        gint             page_num,
> >                                       GtkWidget       *widget)
> > {
> >   GtkNotebookPage *page;
> >   GtkWidget *notebook_page;
> >
> >   page = (GtkNotebookPage*) g_list_nth (GTK_NOTEBOOK (notebook)->children,
> > page_num)->data;
> >   notebook_page = page->child;
> >   gtk_widget_ref (notebook_page);
> >   gtk_notebook_remove_page (GTK_NOTEBOOK (notebook), page_num);
> >   gtk_notebook_insert_page (GTK_NOTEBOOK (notebook), notebook_page,
> >                             widget, page_num);
> >   gtk_widget_unref (notebook_page);
> > }
>
> Hmmm, I'm also puzzled by this, if you _do_ need to change an
> existing noteobok tab label why not use:
>
> void gtk_notebook_set_tab_label_text      (GtkNotebook *notebook,
>                                            GtkWidget   *child,
>                                            const gchar *tab_text);
>
> or:
>
> void gtk_notebook_set_tab_label           (GtkNotebook *notebook,
>                                            GtkWidget   *child,
>                                            GtkWidget   *tab_label);
>
> Regards,
>                                         Owen
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null

--
This message is powered by RedHat 6.1 and Perl
Visit my web site at http://iconmedia.com/cgi-bin/index.pl

Current uptime:
 11:26am  up 16:15,  0 users,  load average: 0.14, 0.11, 0.09





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]