Re: custom widget example




----- Original Message ----- From: "Murray Cumming" <murrayc murrayc com>
To: "Marco" <mscholtn xs4all nl>
Cc: "gtkmm-list" <gtkmm-list gnome org>
Sent: Tuesday, January 11, 2005 1:33 PM
Subject: Re: custom widget example


On Tue, 2005-01-11 at 09:21 +0100, Marco wrote:
Even better when i don't change m_RefGC because this also changes the
style of the other widgets (in this case the button)

Could it be that Gdk::Window::create() creates a refptr to a copy, and
we are then painting on the wrong window?

I am not sure what you mean. create() creates a new instance, which you
access via a RefPtr.

That's what i meant, this new instance is in no way connacted to the widget, so we are drawing somewhere in memory but it never gets displayed (i think).

There is still the problem now that it is not really the widget that gets painted but its parent window.
So i tried:
unset_flags(Gtk::NO_WINDOW);
set_window( Gdk::Window::create(get_window() /* parent */, &attributes, GDK_WA_X | GDK_WA_Y) );
m_refGdkWindow = get_window();

It works but now the widget doesn't receive an expose event anymore.

[snip]
//    m_refGdkWindow = Gdk::Window::create(get_window() /* parent */,
&attributes, GDK_WA_X | GDK_WA_Y);
    m_refGdkWindow = get_window();

Thanks a lot. That works, though I don't know why it didn't work before.

I have committed the change to cvs. Please try to create a cvs patch in
future - it's easier for us to see what has actually changed:
http://www.gtkmm.org/bugs.shtml#CreatingPatches

Ok i will do that in future, i will try to fix the example later this week and create a patch.

--
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]