Re: GtkNotebook with action on click of special tab



Hi Bernhard

Not sure what you are trying to do.

Gtk_Notebook is a nice feature. What I found works is to process the "switch-page" signal.

Generally I setup each page prior to displaying it and associate my own control data with each page. (From memory GTK does not bother to display blank pages, which can be confusing)

Then I display the page I want.

If the user tabs to another page, I let gtk handle the page switch and handle input from the selected page as appropriate, using my own control data to do this.

I suppose there is a case for writing my own extention for gtk-notebook, a derived class, but have not tried this, as I prefer to keep my own data completely separate from GTK.

The only thing to watch is that if you delete a tabbed page, then the page index for all higher pages decrements. Just allow for this when switching your own control data

Hope this helps

Bill C

On 20/04/11 09:34, Bernhard Schuster wrote:
Hi I am trying to achieve the effect of new tab openening if one tab gets
selected. Unfortunaltly the doc is very sparse on that:
http://developer.gnome.org/gtk/stable/GtkNotebook.html as of using the
"select-page" signal. Can anyone give me a hint how to use it properly with
a g_signal_connect function?

Note: I am still in a learning phase so please be patient with me :)

What I tried so far:

gboolean
derived_notebook_insert_page (DerivedNotebook *obj, gboolean b, gpointer
data)
{
// do page insert
}

and within foo_derived_notebook_init: g_signal_connect (obj, "select-page",
G_CALLBACK (derived_notebook_insert_page), NULL);

If anybody could shed some light of what the return value is for, and how to
achiev what I want, thanks very much

Regards

B.
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list





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