Re: How to draw a notebook tab?



Στις 15/8/2012 12:59, ο/η Georgios Petasis έγραψε:
Στις 14/8/2012 11:20, ο/η George Petasis έγραψε:
Hi all,

Can anyone help me in how to draw a notebook tab?
I am using Gtk to draw widgets for a non-Gtk application. I have made some progress (i.e. here http://www.ellogon.org/~petasis/tcl/Images/ttkgtk3/TtkGtk3-Preview2.png and here http://www.ellogon.org/~petasis/tcl/Images/ttkgtk3/TtkGtk3-Preview3.png). However I am facing problems with the notebook tabs and spinbox.

I have looked into the notebook sources, and tried to copy how the notebook widget draws its tabs. I can draw something that looks like a tab, but the upper part is always missing (I don't know why).
Can somebody explain how can I render a tab, using gtk_render_extension?

Regards,

George

Can somebody help my in how to draw a notebook tab?

I am calling gtk_render_extension() with x:5, y:5, w:112, h=34, orientation: GTK_POS_TOP,
but I am getting this:

http://www.ellogon.org/~petasis/tcl/Images/ttkgtk3/Tab.png

How can I draw the upper part of the tab?
Why it is missing?
I event provided a drawable larger than the box I give in gtk_render_extension(), but again the upper tab part is missing.

How can I draw a tab?

George
I have made some progress, I need to add:
gtk_style_context_add_region (context, GTK_STYLE_REGION_TAB,
                                               GTK_REGION_FIRST);

However, now I have a different problem: my tabs are inverted:

http://www.ellogon.org/~petasis/tcl/Images/ttkgtk3/TtkGtk3-Preview4.png

How can I fix this?

George



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