1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/gtk/nativewin.cpp
3 // Purpose: wxNativeWindow implementation
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwindows.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 // ============================================================================
13 // ============================================================================
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 // for compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
29 #include "wx/nativewin.h"
33 // ============================================================================
35 // ============================================================================
37 bool wxNativeContainerWindow::Create(wxNativeContainerWindowHandle win
)
39 if ( !wxTopLevelWindow::Create(NULL
, wxID_ANY
, "") )
42 // we need to realize the window first before reparenting it
43 gtk_widget_realize(m_widget
);
44 gdk_window_reparent(m_widget
->window
, win
, 0, 0);
46 // we should be initially visible as we suppose that the native window we
47 // wrap is (we could use gdk_window_is_visible() to test for this but this
48 // doesn't make much sense unless we also react to visibility changes, so
49 // just suppose it's always shown for now)
55 bool wxNativeContainerWindow::Create(wxNativeContainerWindowId anid
)
58 GdkWindow
* const win
= gdk_window_foreign_new(anid
);
64 else // invalid native window id
72 wxNativeContainerWindow::~wxNativeContainerWindow()
74 // there doesn't seem to be anything to do here, GTK+ seems to handle
75 // everything correctly due to its use of reference counting