commit ccf80260a0bd86a50a95e2e9613bd8e0d4aa03d5
parent f059f37e3e065a29fe630c9808a5ed059328dc5f
Author: bsandro <email@bsandro.tech>
Date: Sun, 21 Dec 2025 08:37:24 +0200
bugfix: closing dialog window no longer closes whole app
Diffstat:
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/TODO b/TODO
@@ -16,5 +16,8 @@
- M$ Windows build
- Use system open/save dialog on Windows?
+ Remember last open directory
-- Bug: closing the modal window closes the application
-- Bug: large amount of frames doesn't let to choose 1frame height properly.
++ Bug: closing the modal window closes the application
++ Bug: large amount of frames doesn't let to choose 1frame height properly.
+- 'System' menu emulation (File, Open, Save)
+- Support saving spritesheet as .png file
+- 'Help' and 'About' windows
diff --git a/gui/ui.c b/gui/ui.c
@@ -72,8 +72,11 @@ UIWindow * MainWindowCreate(const char *wname, int w, int h) {
}
int WinModalEvent(UIElement *element, UIMessage msg, int di, void *dp) {
+ if (msg==UI_MSG_WINDOW_CLOSE) {
+ UIElementDestroy(element);
+ return 1;
+ }
if (msg==UI_MSG_DESTROY) {
- //printf("modal bye\n");
assert(element==(UIElement *)modal_win);
modal_win = NULL;
}
@@ -321,7 +324,6 @@ int SliderEvent(UIElement *element, UIMessage msg, int di, void *dp) {
int WinMainEvent(UIElement *element, UIMessage msg, int di, void *dp) {
if (msg==UI_MSG_DESTROY) {
- //printf("main win bye\n");
free(img);
exit(0);
}