Is it possible in Gtk+ to have an add-tab button inline with the tabs in a notebook, ala Opera or Google Chrome? I do know that Opera uses Qt and Chrome uses custom tabs, but is it possible in pure Gtk+?
A:
Sure. Check out the class BrandedNotebook at line 1384 of this file.
Unfortunately Gtk+ doesn't give you a "nice" way to do this, but you should be able to determine the amount of space available, and use it as you wish. In the case of BrandedNotebook, a pixbuf is drawn in the space, and mouse clicks are handled within the coordinates of the pixbuf.
anthony
2009-06-29 23:05:36
Thank you very much. Haven't done much with Gdk drawing stuff -- that's pretty nasty but it works.
c4757p
2009-06-30 00:59:09
gdk drawing is the fun part!
anthony
2009-06-30 03:38:40
A:
Well, if it is not possible, there is a simple workaround:
- Create a tab with the title "New Tab" or "+" or whatever
- Detect when the tab is selected and, when such happens, create a new tab. Focus on that new tab so that the "New tab" tab isn't ever selected.
luiscubal
2009-06-29 23:12:21