Re: changing default notebook page title
- From: Owen Taylor <otaylor redhat com>
- To: Daniel Hops <Daniel Hops eed ericsson se>
- Cc: gtk-list redhat com
- Subject: Re: changing default notebook page title
- Date: 18 Nov 1999 09:27:53 -0500
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]