[Glade-users] notebook tabs



On Mon, May 11, 2009 at 10:35 PM, Chris Bare <chris at bareflix.com> wrote:

I also noticed that I got an error when I tried to add pages that all referred
to the same widget as their contents. It did seem to work, however.

Its not supposed to work, expect problems; i.e. a widget can have only
one parent, and a notebook uses one widget per page (i.e. a page *is*
a widget).


Is there some other way to use the same body widget and just use the tabs to
tell your program what to display there? I don't really need to create 10
different text widgets, do I?

If all you want is the tabs then just put empty box widgets in your
notebook tabs, programatically.

i.e.:
  -create the notebook with no pages
  -load it with builder and add pages (one empty GtkHBox for every page)
  -handle the signal on the notebook that tells you that the page changed
  -reload the data in your layout directly below the notebook tabs.

Note in this solution your notebook children sholdnt expand horizontally,
maybe actually your notebook shouldnt expand horizonally even, just
to make sure that the content portion of your notebook tabs isnt
visible.

Cheers,
             -Tristan




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