Re: Gtk::Style usage help needed

Ok, I'll try to explain what I want to do, so you can tell me if I'm doing it
the way is supposed to be done. 

As you said, I want to modify how widgets are drawn (by using cairo inside
the style virtual functions), and I have no intention of creating a new
complete theme engine. If all applications should share the same look is a
point of view quite extended , but what I want to do is just the opposite
(define my own look and feel in my application) 

I'm trying to do it just the way you mentioned, by calling set_style in the
affected widgets. But if we recover the example code, I'm getting some pango
errors and a segfault when trying to use an overloaded Gtk::Style in a label
widget (other widgets I have tested works fine with this approach). 

I've been looking to the Gtk::Style code in and the create()
function does nothing but create the Glib::RefPtr, so I'm quite confused
write now. ¿what can it be wrong? 


José Alburquerque wrote:
> On Fri, 2010-10-29 at 00:40 -0700, siagogam wrote: 
>> Yes I've already tried in my test example the Gtk::Style::create() and
>> works
>> fine, but what I want to do is overload the style drawing functions in
>> order
>> to perform some changes in the way some widgets are drawn. I can not do
>> that
>> using the create static method.
> As Paul said, users normally determine the look of applications on their
> desktop by selecting themes themselves.  If you should still want to
> modify how widgets are drawn for some reason, the best way to do it, I
> think, is by using the various style manipulating methods in the
> Gtk::Widget API[1] such as get_style()[2], set_style()[3] and
> modify_style()[4] among others.
> [1]
> [2]
> [3]
> [4]
>> I'm not sure of whats rcstyle for, but I think its for defining the
>> system
>> apearance through an rc style file. is this true? Anyway, thats not what
>> I'm
>> looking for.
>> Gtk::Style offers lots of protected virtual methods, so its' designed to
>> be
>> inherited, but in the other hand the label style seems to depend on the
>> code
>> executed in the create() method, that can not be overloaded. Is this a
>> bug?
>> TIA
> -- 
> José
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org

View this message in context:
Sent from the Gtkmm mailing list archive at

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