From b0cf022ea75b763531e6ae63abccadf2bfa7a84b Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 26 Mar 2017 11:21:43 +0200 Subject: Make plugingui test app nest the UI in a native window. --- plugingui/testmain.cc | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'plugingui/testmain.cc') diff --git a/plugingui/testmain.cc b/plugingui/testmain.cc index b1697eb..0bbd21f 100644 --- a/plugingui/testmain.cc +++ b/plugingui/testmain.cc @@ -35,19 +35,32 @@ #include #include +#include "window.h" #include "mainwindow.h" int main() { INFO(example, "We are up and running"); + GUI::Window parent{nullptr}; + parent.setCaption("PluginGui Test Application"); + Settings settings; - GUI::MainWindow main_window(settings, nullptr); + GUI::MainWindow main_window(settings, parent.getNativeWindowHandle()); + + parent.show(); main_window.show(); - main_window.resize(370, 330); - while(main_window.processEvents()) + parent.resize(370, 330); + + while(true) { + parent.eventHandler()->processEvents(); + if(!main_window.processEvents()) + { + break; + } + #if DG_PLATFORM == DG_PLATFORM_WINDOWS SleepEx(50, FALSE); #else -- cgit v1.2.3