Re: [gtkmm] Gdk::Window problem



> Murray Cumming wrote:
>
>>>I found the problem, why Gdk::Window in GTKMM-2.4 is not compatible now
>>>with GdkWindow in GTK+-2.4.
>>>
>>>
>>
>>What do you mean? Exactly what problem are you encountering?

[snip]

> GTKMM declaring paint_layout fucntion that take
> Glib::RefPtr<Gdk::Window> as parameter, but we cannot cast Gdk::Drawable
> to Gdk::Window, because Gdk::Drawable is base of Gdk::Window (see
> Glib::RefPtr casting rules).

This is the only part of your email that looks like a problem that you
have encountered. Why can't you cast Glib::RefPtr<Gdk::Drawable> to
Glib::RefPtr<Gdk::Window> by using RefPtr::cast_dynamic, like so:

Glib::RefPtr<Gdk::Drawable refDrawable;
Glib::RefPtr<Gdk::Window> refWindow =
  Glib::RefPtr<Gdk::Window>::cast_dynamic(refDrawable);

http://www.gtkmm.org/docs/glibmm-2.4/docs/reference/html/classGlib_1_1RefPtr.html#e0

[snip]
> Also, If you look at GTK+ code, you will find that almost all functions
> are taking GdkWindow (equal to GdkDrawable) as argument. And that may
> cause potential problems for developers in GTKMM.

If a GTK+ function has a GdkWindow* parameter that can actually be some
other GdkDrawable* (not a GdkWindow*), then that would be a GTK+ bug.
Please CC me on any such bugzilla bugs.


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]