]>
git.saurik.com Git - wxWidgets.git/blob - src/motif/popupwin.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxPopupWindow implementation
4 // Author: Mattia barbon
8 // Copyright: (c) Mattia barbon
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
13 #pragma implementation "popup.h"
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
19 #include "wx/popupwin.h"
23 #pragma message disable nosimpint
27 #pragma message enable nosimpint
30 #include "wx/motif/private.h"
32 IMPLEMENT_DYNAMIC_CLASS( wxPopupWindow
, wxWindow
);
34 bool wxPopupWindow::Create( wxWindow
*parent
, int flags
)
36 if( !wxPopupWindowBase::Create( parent
, flags
) )
41 parent
->AddChild( this );
43 Widget popup
= XtVaCreatePopupShell( "shell",
44 overrideShellWidgetClass
,
45 (Widget
)wxTheApp
->GetTopLevelWidget(),
48 m_mainWidget
= (WXWidget
)popup
;
50 SetSize( 100, 100 ); // for child creation to work
52 XtSetMappedWhenManaged( popup
, False
);
53 XtRealizeWidget( popup
);
58 bool wxPopupWindow::Show( bool show
)
60 if( !wxWindowBase::Show( show
) )
65 XtPopup( (Widget
)GetMainWidget(), XtGrabNone
);
69 XtPopdown( (Widget
)GetMainWidget() );