Re: Maemomm Gdk::Window problem
- From: Murray Cumming <murrayc murrayc com>
- To: Lassi Väätämöinen <lassi vaatamoinen gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: Maemomm Gdk::Window problem
- Date: Fri, 25 Jan 2008 08:15:37 +0100
On Thu, 2008-01-24 at 18:20 +0200, Lassi Väätämöinen wrote:
> The code below works fine when compiled on Linux platform (Ubuntu):
>
> class MyDrawingArea : public Gtk::DrawingArea {
> public:
> int getXWinID();
> };
>
>
> int MyDrawingArea::getXWinID()
> {
> int xWindowId;
> Glib::RefPtr<Gdk::Window> gwindow = get_window();
>
> if (gwindow)
> {
> xWindowId = GDK_WINDOW_XID(Glib::unwrap(get_window()));
> std::cout<< "DrawingArea Xwin id: "<< xWindowId <<"\n";
> }
>
> return xWindowId;
> }
>
>
> getXWinID() returns the window ID correctly. However, when built and run on
> Maemo -platform (scratchbox & N800), xWindowId == 0, because the if -branch
> is not taken, i.e. gwindow == NULL.
When are you calling this? I believe that get_window() only returns a
window after the widget has been realized. So you should probably be
doing it in an on_realize() or a signal_realize handler.
>
> Is there something to Glib::RefPtr or Gdk::WIndow on Maemomm that I have
> missed?
>
> -Lassi
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
--
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]