new function MwWindowShouldClose
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
This commit is contained in:
parent
f260c3c11e
commit
b20a54fb76
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);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @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
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -35,6 +35,10 @@ static void mwWindowMakeBorderlessImpl(MwWidget handle, int toggle) {
|
|||
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) {
|
||||
(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);
|
||||
mwWindowMakeBorderlessImpl(handle, toggle);
|
||||
}
|
||||
if(strcmp(name, "mwWindowShouldClose") == 0) {
|
||||
MwBool *out = va_arg(va, MwBool*);
|
||||
mwWindowShouldCloseImpl(handle, out);
|
||||
}
|
||||
}
|
||||
MwClassRec MwWindowClassRec = {
|
||||
wcreate, /* create */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue