Re: RcStyle::set_bg_pixmap_name() working only for some classes
- From: "Matt Hoosier" <matt hoosier gmail com>
- To: "Murray Cumming" <murrayc murrayc com>
- Cc: gtkmm-list gnome org
- Subject: Re: RcStyle::set_bg_pixmap_name() working only for some classes
- Date: Wed, 18 Oct 2006 08:14:38 -0500
On 10/18/06, Murray Cumming <murrayc murrayc com> wrote:
On Tue, 2006-10-17 at 15:26 -0500, Matt Hoosier wrote:
> I'd like to install a pixmap (not known until runtime) as the
> background image for a widget.
>
> Using a custom RcStyle with the "bg_pixmap" property set seems like it
> ought to do the chore:
>
> Gtk::Widget w = ...;
> const Glib::RefPtr<Gtk::RcStyle> style = Gtk::RcStyle::create ();
> style->set_bg_pixmap_name (Gtk::STATE_NORMAL, "/path/to/image.png");
> w.modify_style (style);
>
> This only seems to work for those classes (and not their derived
> classes) which are not GTK_WIDGET_NO_WINDOW. That is, it works for
> Gtk::DrawingArea, Gtk::EventBox, and a couple of others.
>
> If I try to instantiate "w" above as an instance of the following class:
>
> class DerivedEventBox : public Gtk::EventBox
> {
> public:
> DerivedEventBox () : Gtk::EventBox () {}
> virtual ~DerivedEventBox() {}
> };
>
> the background PNG does not appear. Yet if I do a trivial
> GObject-based subclass of GtkEventBox and use the result of
> Glib::wrap() as the value of "w" above, the pixmap appears [as
> expected?].
>
> Is there some subtlety to the way that the GType inheritance works in
> parallel with the C++ inheritance?
I wonder whether this bug is causing it:
http://bugzilla.gnome.org/show_bug.cgi?id=343012
Can you try the GTK+ patch to rule that out?
As it happens, I already apply that patch on my Gtk+ build.
--
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]