Re: [gtkmm] switching styles impossible?
- From: Paul Davis <pbd op net>
- To: Morten Brix Pedersen <morten wtf dk>
- Cc: RevX gmx at, gtkmm-list gnome org
- Subject: Re: [gtkmm] switching styles impossible?
- Date: Fri, 26 Jul 2002 13:52:53 -0400
>Hi,
>
>* RevX gmx at <RevX gmx at> [2002-07-26 17:03:32]:
>> I'm using gtkmm 1.2.8 and I'd like to know if it's possible to
>> apply a style to a widget (ie. a button) AFTER the widget
>> got show()'n?! And if yes, how? Is it possible to switch
>> styles for a widget? (I've tried to simply apply a style
>> to a button after the ctor call but that just leads to a segfault.)
>
>Try something like:
>
> Gdk_Color color("white");
> Gtk::Style *style = Gtk::Style::create();
> style->set_fg(GTK_STATE_NORMAL, color);
> button.set_style(*style);
much better, i think, to use:
button.set_name ("current_name");
combined with an RC file containing:
style "current_name_style" {
fg[NORMAL] = { 1.0, 1.0. 1.0 }
}
widget "*current_name" style "current_name_style"
--p
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]