File tree 3 files changed +29
-0
lines changed
3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,11 @@ class DISTRHO_API Window
158
158
*/
159
159
virtual ~Window ();
160
160
161
+ /* *
162
+ TEST.
163
+ */
164
+ Window* createPopup ();
165
+
161
166
/* *
162
167
Whether this Window is embed into another (usually not DGL-controlled) Window.
163
168
*/
@@ -574,6 +579,9 @@ class DISTRHO_API Window
574
579
bool usesSizeRequest,
575
580
bool doPostInit);
576
581
582
+ /* * @internal */
583
+ explicit Window (Application& app, Window& transientParentWindow, uint type);
584
+
577
585
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Window)
578
586
};
579
587
Original file line number Diff line number Diff line change @@ -111,6 +111,15 @@ Window::Window(Application& app,
111
111
pData->initPost ();
112
112
}
113
113
114
+ Window::Window (Application& app, Window& transientParentWindow, const uint type)
115
+ : pData(new PrivateData(app, this , transientParentWindow.pData))
116
+ {
117
+ if (pData->view != nullptr )
118
+ puglSetViewHint (pData->view , PUGL_VIEW_TYPE, type);
119
+
120
+ pData->initPost ();
121
+ }
122
+
114
123
Window::Window (Application& app,
115
124
const uintptr_t parentWindowHandle,
116
125
const uint width,
@@ -132,6 +141,11 @@ Window::~Window()
132
141
delete pData;
133
142
}
134
143
144
+ Window* Window::createPopup ()
145
+ {
146
+ return new Window (pData->app , *this , PUGL_VIEW_TYPE_UTILITY);
147
+ }
148
+
135
149
bool Window::isEmbed () const noexcept
136
150
{
137
151
return pData->isEmbed ;
Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ class FileHandlingExampleUI : public UI,
49
49
static const uint kInitialWidth = 600 ;
50
50
static const uint kInitialHeight = 350 ;
51
51
52
+ ScopedPointer<Window> win;
53
+
52
54
FileHandlingExampleUI ()
53
55
: UI(kInitialWidth , kInitialHeight ),
54
56
fButton1 (this , this ),
@@ -70,6 +72,11 @@ class FileHandlingExampleUI : public UI,
70
72
#endif
71
73
72
74
setGeometryConstraints (kInitialWidth , kInitialHeight , false );
75
+
76
+ win = getWindow ().createPopup ();
77
+ win->setTitle (" test1" );
78
+ win->setSize (300 , 300 );
79
+ win->runAsModal ();
73
80
}
74
81
75
82
protected:
You can’t perform that action at this time.
0 commit comments