Re: Derived widget in libglademm
- From: Philipp Klaus Krause <pkk spth de>
- To: Murray Cumming <murrayc murrayc com>
- Cc: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: Derived widget in libglademm
- Date: Sun, 02 Sep 2007 17:40:48 +0200
Murray Cumming schrieb:
> On Sun, 2007-09-02 at 00:31 +0200, Philipp Klaus Krause wrote:
>> Murray Cumming schrieb:
>>
>>> I guess I'd need to see a complete compileable simple test case to
>>> figure this out.
>
> Here is a self-contained test that uses libglademm and a test that does
> not, with the build command in a comment at the top of each file.
>
> I see that on_realize() is indeed not called when using
> get_widget_derived(). From the g_warning() about using
> set_gl_capability() after realize, it seems that the realize signal has
> already been called before our C++ instance was constructed. That's
> unusual.
>
> However, the default signals are being used in general. I added an
> on_expose_event() override to show that.
>
> You are not the first person to discover this, it seems:
> http://lists.ximian.com/pipermail/glade-users/2005-March/002430.html
> And here's a message about the same problem with regular libglade:
> http://mail.gnome.org/archives/gtk-list/2006-June/msg00065.html
> which maybe has your solution, though it seems odd.
> "
> Solution: don't enable the visible attribute on widgets that you want
> to catch the realize event and show this widgets manually with your
> own code
> "
Thanks a lot for your help. I'm new to libglademm and it's been a few
years since I used gtkmm.
I solved the problem using a "creation function" (an extern "C" wrapper
around my constructor, looks somehow ugly in a C++ program). Now
on_realize() is called. I've posted a .tar.gz of a working program on
the list. on_realize(), on_configure_event(), on_expose_event() are
called correctly. The visible attribute is enabled in glade.
There's a small working sample program to the list in my "gtkglextmm
with libglade example - source attached" posting.
Philipp
P.S.: I currently have a problem with on_button_pres_event() not being
called, if I don't find a solution I'll post on the list soon.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]