Closed Vucius closed 1 year ago
on_closing
is only triggered when you click the "x" button in the top-left corner of the window (or top-right depending on the operating system) to close it. There is no other way to programmatically trigger it. That is the reason why I added support for on_destroy
in Glimmer DSL for LibUI. It's because there is no way to hook into on_closing
if you close the window programmatically by calling window_object.destroy
. Using LibUI.quit
is the correct way to exit if you want to programmatically end the LibUI app after closing the window.
Given that you already have the solution, I am closing this issue. But, if you have further questions or are not satisifed with the answer, feel free to reply or even re-open the issue.
on_closing
is only triggered when you click the "x" button in the top-left corner of the window (or top-right depending on the operating system) to close it. There is no other way to programmatically trigger it. That is the reason why I added support foron_destroy
in Glimmer DSL for LibUI. It's because there is no way to hook intoon_closing
if you close the window programmatically by callingwindow_object.destroy
. UsingLibUI.quit
is the correct way to exit if you want to programmatically end the LibUI app after closing the window.Given that you already have the solution, I am closing this issue. But, if you have further questions or are not satisifed with the answer, feel free to reply or even re-open the issue.
Thank you for your explanation.Moving forward, I checked both the Glimmer DSL API and Go UI (Golang LibUI) API Documentation and did not find any methods for controlling window position. I wanted to ask if there are currently no related methods available. In the past, when using TK
, I was able to control window position by obtaining the screen size.
Setting the window position is an upcoming feature in LibUI-NG: https://github.com/libui-ng/libui-ng/pull/62
Once it is released, it can be included in Glimmer DSL for LibUI.
Code:
The problem is that when rrr.destroy is executed, the window is closed but the program does not capture
WM_CLOSE
or exit. If I add the statementLibUI.quit
afterrrr.destroy
, the program will exit directly. So I would like to know how to trigger sending aWM_CLOSE
message to the program. I am currently usingon_destroy
instead ofon_closing
. Although it has accomplished my task, I am still curious about how to triggeron_closing
. Thank you.