So, here it is, the First screenshot of my Ribbon for SoC 2007.
It is using Cairo for all drawing, Pango for all text rendering running on my lovely Arch Linux. I think that the drawing of tabs is quite nice, but the rendering of the body is still not completed. You can see the Ribbon widget (inherits Gtk.Container) and RibbonGroup (inherits Gtk.Bin). The button is the 1st group is just a Gtk.Button. The height of a group is 90 pixels by default. It width is automaticaly computed to fit the content. If it is empty, it fits the label.
I have one big problem for now: how the hell do I change the color of the text in a Gtk.Label ??? I have tried ModifyFg and ModifyText without success. Any idea ?
Here is the code of the sample:
VBox master = new VBox (); Title = "Ribbons Sample"; AppPaintable = true; button0 = new Button (); button0.Label = "Hello World"; group0 = new RibbonGroup (); group0.Label = "Summer of Code"; group0.Child = button0; group1 = new RibbonGroup (); group1.Label = "I will be back"; HBox page0 = new HBox (false, 2); page0.PackStart (group0, false, false, 0); page0.PackStart (group1, false, false, 0); HBox page1 = new HBox (false, 2); HBox page2 = new HBox (false, 2); Label pageLabel0 = new Label ("Page 1"); Label pageLabel1 = new Label ("Page 2"); Label pageLabel2 = new Label ("Page 3"); ribbon = new Ribbon (); ribbon.AppendPage (page0, pageLabel0); ribbon.AppendPage (page1, pageLabel1); ribbon.AppendPage (page2, pageLabel2); TextView txt = new TextView (); master.PackStart (ribbon, false, false, 0); master.PackStart (txt, true, true, 0); Add (master);