plusui-native-core 0.1.32 → 0.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -639,6 +639,22 @@ void Window::setIconFromMemory(const unsigned char *data, size_t size) {
|
|
|
639
639
|
|
|
640
640
|
WindowState Window::getState() const { return pImpl->state; }
|
|
641
641
|
|
|
642
|
+
void Window::close() {
|
|
643
|
+
#ifdef _WIN32
|
|
644
|
+
if (pImpl->hwnd)
|
|
645
|
+
PostMessage(pImpl->hwnd, WM_CLOSE, 0, 0);
|
|
646
|
+
#elif defined(__APPLE__)
|
|
647
|
+
if (pImpl->nativeWindow) {
|
|
648
|
+
NSWindow *nswin = (__bridge NSWindow *)pImpl->nativeWindow;
|
|
649
|
+
[nswin close];
|
|
650
|
+
}
|
|
651
|
+
#else
|
|
652
|
+
if (pImpl->nativeWindow) {
|
|
653
|
+
gtk_widget_destroy(GTK_WIDGET(pImpl->nativeWindow));
|
|
654
|
+
}
|
|
655
|
+
#endif
|
|
656
|
+
}
|
|
657
|
+
|
|
642
658
|
void Window::onMove(MoveCallback callback) {
|
|
643
659
|
pImpl->moveCallbacks.push_back(callback);
|
|
644
660
|
}
|