MwWindowShouldClose #29
2 changed files with 21 additions and 0 deletions
|
|
@ -27,6 +27,19 @@ MwInline void MwWindowMakeBorderless(MwWidget handle, int toggle) {
|
||||||
MwVaWidgetExecute(handle, "mwWindowMakeBorderless", NULL, toggle);
|
MwVaWidgetExecute(handle, "mwWindowMakeBorderless", NULL, toggle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Whether the window should close
|
||||||
|
* @param handle Widget
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
MwInline MwBool MwWindowShouldClose(MwWidget handle) {
|
||||||
|
MwBool res = MwFALSE;
|
||||||
|
MwVaWidgetExecute(handle, "mwWindowShouldClose", NULL, &res);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,10 @@ static void mwWindowMakeBorderlessImpl(MwWidget handle, int toggle) {
|
||||||
MwLLEndStateChange(handle->lowlevel);
|
MwLLEndStateChange(handle->lowlevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void mwWindowShouldCloseImpl(MwWidget handle, MwBool* out) {
|
||||||
|
*out = handle->close;
|
||||||
|
}
|
||||||
|
|
||||||
static void func_handler(MwWidget handle, const char* name, void* out, va_list va) {
|
static void func_handler(MwWidget handle, const char* name, void* out, va_list va) {
|
||||||
(void)out;
|
(void)out;
|
||||||
|
|
||||||
|
|
@ -42,6 +46,10 @@ static void func_handler(MwWidget handle, const char* name, void* out, va_list v
|
||||||
int toggle = va_arg(va, int);
|
int toggle = va_arg(va, int);
|
||||||
mwWindowMakeBorderlessImpl(handle, toggle);
|
mwWindowMakeBorderlessImpl(handle, toggle);
|
||||||
}
|
}
|
||||||
|
if(strcmp(name, "mwWindowShouldClose") == 0) {
|
||||||
|
MwBool *out = va_arg(va, MwBool*);
|
||||||
|
mwWindowShouldCloseImpl(handle, out);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
MwClassRec MwWindowClassRec = {
|
MwClassRec MwWindowClassRec = {
|
||||||
wcreate, /* create */
|
wcreate, /* create */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue