mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-06 17:39:45 +00:00
inherit
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@310 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
17
src/core.c
17
src/core.c
@@ -349,11 +349,24 @@ void MwVaListApply(MwWidget handle, va_list va) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void inherit_text(MwWidget handle, const char* key, const char* default_value) {
|
||||||
|
const char* text;
|
||||||
|
MwWidget h = handle;
|
||||||
|
while(h != NULL) {
|
||||||
|
if((text = MwGetText(h, key)) != NULL) {
|
||||||
|
MwSetText(handle, key, text);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
h = h->parent;
|
||||||
|
}
|
||||||
|
MwSetText(handle, key, default_value);
|
||||||
|
}
|
||||||
|
|
||||||
void MwSetDefault(MwWidget handle) {
|
void MwSetDefault(MwWidget handle) {
|
||||||
MwLLSetCursor(handle->lowlevel, &MwCursorDefault, &MwCursorDefaultMask);
|
MwLLSetCursor(handle->lowlevel, &MwCursorDefault, &MwCursorDefaultMask);
|
||||||
|
|
||||||
MwSetText(handle, MwNbackground, MwDefaultBackground);
|
inherit_text(handle, MwNbackground, MwDefaultBackground);
|
||||||
MwSetText(handle, MwNforeground, MwDefaultForeground);
|
inherit_text(handle, MwNforeground, MwDefaultForeground);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MwDispatchUserHandler(MwWidget handle, const char* key, void* handler_data) {
|
void MwDispatchUserHandler(MwWidget handle, const char* key, void* handler_data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user