mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-10 03:13:28 +00:00
cache these attributes
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@824 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
31
src/core.c
31
src/core.c
@@ -460,11 +460,22 @@ void MwVaApply(MwWidget handle, ...) {
|
||||
|
||||
void MwVaListApply(MwWidget handle, va_list va) {
|
||||
char* key;
|
||||
int x = MwDEFAULT, y = MwDEFAULT, w = MwDEFAULT, h = MwDEFAULT;
|
||||
|
||||
while((key = va_arg(va, char*)) != NULL) {
|
||||
if(key[0] == 'I') {
|
||||
int n = va_arg(va, int);
|
||||
MwSetInteger(handle, key, n);
|
||||
if(strcmp(key, MwNx) == 0) {
|
||||
x = n;
|
||||
} else if(strcmp(key, MwNy) == 0) {
|
||||
y = n;
|
||||
} else if(strcmp(key, MwNwidth) == 0) {
|
||||
w = n;
|
||||
} else if(strcmp(key, MwNheight) == 0) {
|
||||
h = n;
|
||||
} else {
|
||||
MwSetInteger(handle, key, n);
|
||||
}
|
||||
} else if(key[0] == 'S') {
|
||||
char* t = va_arg(va, char*);
|
||||
MwSetText(handle, key, t);
|
||||
@@ -476,6 +487,24 @@ void MwVaListApply(MwWidget handle, va_list va) {
|
||||
MwSetVoid(handle, key, v);
|
||||
}
|
||||
}
|
||||
if(x != MwDEFAULT && y != MwDEFAULT) {
|
||||
MwLLSetXY(handle->lowlevel, x, y);
|
||||
} else {
|
||||
if(x != MwDEFAULT) {
|
||||
MwSetInteger(handle, MwNx, x);
|
||||
} else if(y != MwDEFAULT) {
|
||||
MwSetInteger(handle, MwNy, y);
|
||||
}
|
||||
}
|
||||
if(w != MwDEFAULT && h != MwDEFAULT) {
|
||||
MwLLSetWH(handle->lowlevel, w, h);
|
||||
} else {
|
||||
if(w != MwDEFAULT) {
|
||||
MwSetInteger(handle, MwNwidth, w);
|
||||
} else if(h != MwDEFAULT) {
|
||||
MwSetInteger(handle, MwNheight, h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void inherit_integer(MwWidget handle, const char* key, int default_value) {
|
||||
|
||||
Reference in New Issue
Block a user