diff --git a/examples/basic/calculator.c b/examples/basic/calculator.c
index 8889e97d..f066e6ea 100644
--- a/examples/basic/calculator.c
+++ b/examples/basic/calculator.c
@@ -31,10 +31,10 @@ static void MWAPI resize(MwWidget handle, void* client, void* user) {
}
static void MWAPI activate(MwWidget handle, void* client, void* user) {
- const char* n = MwGetText(handle, MwNtext);
+ const char* n = MwGetString(handle, MwNtext);
if(('0' <= n[0] && n[0] <= '9') || n[0] == '.') {
- const char* s = MwGetText(inp, MwNtext);
+ const char* s = MwGetString(inp, MwNtext);
char* r;
if(n[0] == '.' && s != NULL) {
@@ -52,7 +52,7 @@ static void MWAPI activate(MwWidget handle, void* client, void* user) {
NULL);
free(r);
} else if(n[0] == 'E') {
- const char* s = MwGetText(inp, MwNtext);
+ const char* s = MwGetString(inp, MwNtext);
if(s != NULL) {
stack[sp++] = atof(s);
diff --git a/examples/basic/colorpicker.c b/examples/basic/colorpicker.c
index d02e3576..f67589d3 100644
--- a/examples/basic/colorpicker.c
+++ b/examples/basic/colorpicker.c
@@ -15,7 +15,7 @@ void MWAPI file_callback(MwWidget handle, void* user_data, void* call_data) {
rgb->green &= 0xff;
rgb->blue &= 0xff;
MwStringPrintIntoBuffer(hexColor, 8, "#%02X%02X%02X", rgb->red, rgb->green, rgb->blue);
- MwSetText(window, MwNbackground, hexColor);
+ MwSetString(window, MwNbackground, hexColor);
}
void MWAPI file_picker(MwWidget handle, void* user_data, void* call_data) {
@@ -27,7 +27,7 @@ void MWAPI file_picker(MwWidget handle, void* user_data, void* call_data) {
MwAddUserHandler(cpicker, MwNcolorChosenHandler, file_callback, NULL);
- MwSetText(cpicker, MwNbackground, MwGetInteger(cpicker, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
+ MwSetString(cpicker, MwNbackground, MwGetInteger(cpicker, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
}
int main() {
@@ -35,14 +35,14 @@ int main() {
window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT,
MwDEFAULT, 640, 480, MwNtitle, "color picker", NULL);
- MwSetText(window, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
- MwSetText(window, MwNforeground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkForeground : MwDefaultForeground);
+ MwSetString(window, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
+ MwSetString(window, MwNforeground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkForeground : MwDefaultForeground);
button = MwVaCreateWidget(MwButtonClass, "button", window, 160, 180, 320, 120,
MwNtext, "change window background",
NULL);
- MwSetText(button, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
- MwSetText(button, MwNforeground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkForeground : MwDefaultForeground);
+ MwSetString(button, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
+ MwSetString(button, MwNforeground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkForeground : MwDefaultForeground);
MwAddUserHandler(button, MwNactivateHandler, file_picker, NULL);
diff --git a/examples/basic/filechooser.c b/examples/basic/filechooser.c
index a9a5ec0b..0251be55 100644
--- a/examples/basic/filechooser.c
+++ b/examples/basic/filechooser.c
@@ -48,7 +48,7 @@ void MWAPI file_picker(MwWidget handle, void* user_data, void* call_data) {
MwAddUserHandler(fpicker, MwNfileChosenHandler, file_callback, NULL);
- MwSetText(fpicker, MwNbackground, MwGetInteger(fpicker, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
+ MwSetString(fpicker, MwNbackground, MwGetInteger(fpicker, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
#ifdef BUG
fpicker_wait = MwTRUE;
diff --git a/examples/basic/periodic.c b/examples/basic/periodic.c
index a5bf531d..f1af2490 100644
--- a/examples/basic/periodic.c
+++ b/examples/basic/periodic.c
@@ -354,9 +354,9 @@ int main() {
f = frame("Tab", -PaddingContent, -PaddingContent, MwTabClass, NULL);
w = child(f);
- MwSetText(MwTabAdd(w, "ABC"), MwNbackground, "#f00");
- MwSetText(MwTabAdd(w, "DEF"), MwNbackground, "#0f0");
- MwSetText(MwTabAdd(w, "GHI"), MwNbackground, "#00f");
+ MwSetString(MwTabAdd(w, "ABC"), MwNbackground, "#f00");
+ MwSetString(MwTabAdd(w, "DEF"), MwNbackground, "#0f0");
+ MwSetString(MwTabAdd(w, "GHI"), MwNbackground, "#00f");
f = frame("TreeView", -PaddingContent, -PaddingContent, MwTreeViewClass, NULL);
w = child(f);
diff --git a/examples/gldemos/clock.c b/examples/gldemos/clock.c
index 9f683b50..2c1c7031 100644
--- a/examples/gldemos/clock.c
+++ b/examples/gldemos/clock.c
@@ -33,10 +33,10 @@ void MWAPI tick(MwWidget handle, void* user, void* call) {
tm = localtime(&t);
MwStringPrintIntoBuffer(buf, 512, "%s %02d %s", mon[tm->tm_mon], tm->tm_mday, wday[tm->tm_wday]);
- MwSetText(ldate, MwNtext, buf);
+ MwSetString(ldate, MwNtext, buf);
MwStringPrintIntoBuffer(buf, 512, "%02d:%02d %s", tm->tm_hour % 12, tm->tm_min, tm->tm_hour >= 12 ? "PM" : "AM");
- MwSetText(ltime, MwNtext, buf);
+ MwSetString(ltime, MwNtext, buf);
render = 1;
@@ -141,10 +141,10 @@ int main() {
MwNtitle, "clock",
NULL);
- bgcolor = MwParseColor(window, MwGetText(window, MwNbackground));
+ bgcolor = MwParseColor(window, MwGetString(window, MwNbackground));
MwColorGet(bgcolor, &br, &bg, &bb);
- fgcolor = MwParseColor(window, MwGetText(window, MwNforeground));
+ fgcolor = MwParseColor(window, MwGetString(window, MwNforeground));
MwColorGet(fgcolor, &fr, &fg, &fb);
opengl = MwCreateWidget(MwOpenGLClass, "clock", window, 0, 0, 100, 100);
diff --git a/include/Mw/Core.h b/include/Mw/Core.h
index 66a3372a..c8c5491f 100644
--- a/include/Mw/Core.h
+++ b/include/Mw/Core.h
@@ -159,7 +159,7 @@ MWDECL void MWAPI MwSetInteger(MwWidget handle, const char* key, int n);
* @param key Key
* @param value Value
*/
-MWDECL void MWAPI MwSetText(MwWidget handle, const char* key, const char* value);
+MWDECL void MWAPI MwSetString(MwWidget handle, const char* key, const char* value);
/*!
* @brief Sets a pointer property
@@ -183,7 +183,7 @@ MWDECL int MWAPI MwGetInteger(MwWidget handle, const char* key);
* @param key Key
* @return Value
*/
-MWDECL const char* MWAPI MwGetText(MwWidget handle, const char* key);
+MWDECL const char* MWAPI MwGetString(MwWidget handle, const char* key);
/*!
* @brief Gets the pointer property
diff --git a/include/Mw/TypeDefs.h b/include/Mw/TypeDefs.h
index bbd9a581..65700dbb 100644
--- a/include/Mw/TypeDefs.h
+++ b/include/Mw/TypeDefs.h
@@ -10,10 +10,10 @@
typedef struct _MwClass * MwClass, MwClassRec;
typedef struct _MwIntegerKeyValue MwIntegerKeyValue;
-typedef struct _MwTextKeyValue MwTextKeyValue;
+typedef struct _MwStringKeyValue MwStringKeyValue;
typedef struct _MwUserHandlerArray MwUserHandlerArray;
typedef struct _MwUserHandlerKeyValue MwUserHandlerKeyValue;
-typedef struct _MwVoidKeyValue MwVoidKeyValue;
+typedef struct _MwPointerKeyValue MwPointerKeyValue;
typedef struct _MwMenu* MwMenu;
typedef struct _MwEntry* MwEntry;
typedef struct _MwViewport* MwViewport;
@@ -62,7 +62,7 @@ typedef void (*MwHandlerClipboardReceived)(MwWidget handle, const char* data);
typedef void(MWAPI* MwUserHandler)(MwWidget handle, void* user_data, void* call_data);
typedef void(MWAPI* MwErrorHandler)(int code, const char* message, void* user_data);
-struct _MwTextKeyValue {
+struct _MwStringKeyValue {
char* key;
char* value;
};
@@ -82,7 +82,7 @@ struct _MwUserHandlerKeyValue {
MwUserHandlerArray* value;
};
-struct _MwVoidKeyValue {
+struct _MwPointerKeyValue {
char* key;
void* value;
};
@@ -101,6 +101,8 @@ struct _MwPixmap {
struct _MwColor {
MwLLColor lowlevel;
MwLLCommonColor common;
+
+ MwWidget handle;
};
struct _MwFont {
@@ -130,11 +132,12 @@ struct _MwWidget {
MwHandlerProp prop_inject_pixmap; /* this is for pixmap; do not use */
MwPixmap* pixmaps;
+ MwColor* colors;
MwIntegerKeyValue* integer;
- MwTextKeyValue* text;
+ MwStringKeyValue* string;
MwUserHandlerKeyValue* handler;
- MwVoidKeyValue* data;
+ MwPointerKeyValue* data;
MwWidget* destroy_queue;
MwWidget* tick_list;
diff --git a/milsko.xml b/milsko.xml
index c053bf7b..7624737e 100644
--- a/milsko.xml
+++ b/milsko.xml
@@ -376,7 +376,7 @@
-
+
@@ -399,7 +399,7 @@
-
+
@@ -408,7 +408,7 @@
-
+
diff --git a/src/core.c b/src/core.c
index c06241e7..f537c5ab 100644
--- a/src/core.c
+++ b/src/core.c
@@ -275,6 +275,7 @@ static MwWidget MwCreateWidget_Internal(MwClass widget_class, const char* name,
h->destroy_inject = NULL;
h->prop_inject_pixmap = NULL;
h->pixmaps = NULL;
+ h->colors = NULL;
h->tick_list = NULL;
h->destroyed = 0;
h->bgcolor = NULL;
@@ -314,13 +315,13 @@ static MwWidget MwCreateWidget_Internal(MwClass widget_class, const char* name,
if(parent != NULL) arrput(parent->children, h);
- sh_new_strdup(h->text);
+ sh_new_strdup(h->string);
sh_new_strdup(h->integer);
sh_new_strdup(h->handler);
sh_new_strdup(h->data);
shdefault(h->integer, MwDEFAULT);
- shdefault(h->text, NULL);
+ shdefault(h->string, NULL);
shdefault(h->handler, NULL);
shdefault(h->data, NULL);
@@ -450,11 +451,11 @@ void MwFreeWidget(MwWidget handle) {
shfree(handle->integer);
- for(i = 0; i < shlen(handle->text); i++) {
- free(handle->text[i].value);
- handle->text[i].value = NULL;
+ for(i = 0; i < shlen(handle->string); i++) {
+ free(handle->string[i].value);
+ handle->string[i].value = NULL;
}
- shfree(handle->text);
+ shfree(handle->string);
for(i = 0; i < shlen(handle->handler); i++) {
arrfree(handle->handler[i].value);
}
@@ -467,6 +468,9 @@ void MwFreeWidget(MwWidget handle) {
while(arrlen(handle->pixmaps) > 0) MwDestroyPixmap(handle->pixmaps[0]);
arrfree(handle->pixmaps);
+ while(arrlen(handle->colors) > 0) MwFreeColor(handle->colors[0]);
+ arrfree(handle->colors);
+
arrfree(handle->draw_queue);
arrfree(handle->resize_queue);
@@ -711,18 +715,18 @@ void MwSetInteger(MwWidget handle, const char* key, int n) {
}
}
-void MwSetText(MwWidget handle, const char* key, const char* value) {
+void MwSetString(MwWidget handle, const char* key, const char* value) {
if(handle->widget_class == MwWindowClass && strcmp(key, MwNtitle) == 0) {
MwLLSetTitle(handle->lowlevel, value);
} else {
char* v = value == NULL ? NULL : MwStringDuplicate(value);
- if(shgeti(handle->text, key) != -1) free(shget(handle->text, key));
+ if(shgeti(handle->string, key) != -1) free(shget(handle->string, key));
if(value != NULL) {
- shput(handle->text, key, v);
+ shput(handle->string, key, v);
} else {
- shdel(handle->text, key);
+ shdel(handle->string, key);
}
}
if(handle->prop_event) {
@@ -814,13 +818,13 @@ int MwGetInteger(MwWidget handle, const char* key) {
}
}
-const char* MwGetText(MwWidget handle, const char* key) {
- if((shgeti(handle->text, key) == -1 || strcmp(shget(handle->text, key), "DEFAULT") == 0) && (strcmp(key, MwNbackground) == 0 || strcmp(key, MwNforeground) == 0 || strcmp(key, MwNsubBackground) == 0 || strcmp(key, MwNsubForeground) == 0 || strcmp(key, MwNtitleBackground) == 0 || strcmp(key, MwNtitleForeground) == 0)) {
+const char* MwGetString(MwWidget handle, const char* key) {
+ if((shgeti(handle->string, key) == -1 || strcmp(shget(handle->string, key), "DEFAULT") == 0) && (strcmp(key, MwNbackground) == 0 || strcmp(key, MwNforeground) == 0 || strcmp(key, MwNsubBackground) == 0 || strcmp(key, MwNsubForeground) == 0 || strcmp(key, MwNtitleBackground) == 0 || strcmp(key, MwNtitleForeground) == 0)) {
const char* v = NULL;
- if(shgeti(handle->text, key) != -1 && strcmp(shget(handle->text, key), "DEFAULT") != 0) {
+ if(shgeti(handle->string, key) != -1 && strcmp(shget(handle->string, key), "DEFAULT") != 0) {
MwWidget h = handle->parent;
while(h != NULL) {
- if((v = MwGetText(h, key)) != NULL) break;
+ if((v = MwGetString(h, key)) != NULL) break;
h = h->parent;
}
}
@@ -844,7 +848,7 @@ const char* MwGetText(MwWidget handle, const char* key) {
return v;
}
- return shget(handle->text, key);
+ return shget(handle->string, key);
}
#if defined(USE_STB_TRUETYPE) || defined(USE_FREETYPE2) || defined(USE_GDI_TEXT)
@@ -930,7 +934,7 @@ static void MwVaListApply_Internal(MwWidget handle, va_list va, int only_early)
char* t = va_arg(va, char*);
if(only_early && key[1] != 'E') continue;
- MwSetText(handle, key, t);
+ MwSetString(handle, key, t);
} else if(key[0] == 'C') {
MwUserHandler h = va_arg(va, MwUserHandler);
if(only_early && key[1] != 'E') continue;
diff --git a/src/dialog/colorpicker.c b/src/dialog/colorpicker.c
index 8e580494..0c59641f 100644
--- a/src/dialog/colorpicker.c
+++ b/src/dialog/colorpicker.c
@@ -185,10 +185,10 @@ static void MWAPI color_picker_click(MwWidget handle, void* user, void* call) {
fb = picker->chosen_color.blue > 128 ? 0 : 255;
MwStringPrintIntoBuffer(fgColor, 8, "#%02X%02X%02X", fr, fg, fb);
- MwSetText(picker->color_display_text, MwNforeground, fgColor);
+ MwSetString(picker->color_display_text, MwNforeground, fgColor);
- MwSetText(picker->color_display_text, MwNbackground, hexColor);
- MwSetText(picker->color_display_text, MwNtext, hexColor);
+ MwSetString(picker->color_display_text, MwNbackground, hexColor);
+ MwSetString(picker->color_display_text, MwNtext, hexColor);
}
static void MWAPI color_picker_on_change_value(MwWidget handle, void* user,
void* call) {
@@ -244,7 +244,7 @@ static void MWAPI color_display_text_change(MwWidget handle, void* user,
(void)call;
- memcpy(&hexColor, MwGetText(handle, MwNtext), 8);
+ memcpy(&hexColor, MwGetString(handle, MwNtext), 8);
color = MwParseColor(handle, hexColor);
@@ -253,10 +253,10 @@ static void MWAPI color_display_text_change(MwWidget handle, void* user,
fb = color->common->blue > 128 ? 0 : 255;
MwStringPrintIntoBuffer(fgColor, 9, "#%02X%02X%02X", fr, fg, fb);
- MwSetText(picker->color_display_text, MwNforeground, fgColor);
+ MwSetString(picker->color_display_text, MwNforeground, fgColor);
- MwSetText(picker->color_display_text, MwNbackground, hexColor);
- MwSetText(picker->color_display_text, MwNtext, hexColor);
+ MwSetString(picker->color_display_text, MwNbackground, hexColor);
+ MwSetString(picker->color_display_text, MwNtext, hexColor);
picker->chosen_color.red = color->common->red;
picker->chosen_color.green = color->common->green;
@@ -302,8 +302,8 @@ color_picker_t* color_picker_setup(MwWidget parent, int w, int h) {
MwEntryClass, "colorDisplayText", picker->parent, IMG_POS_X(w) + (PICKER_SIZE / 2) - ((PICKER_SIZE / 4) / 2),
IMG_POS_Y(h) - (PICKER_SIZE / 16) - MARGIN, (PICKER_SIZE / 4), PICKER_SIZE / 16);
- MwSetText(picker->color_display_text, MwNbackground, "#FFFFFF");
- MwSetText(picker->color_display_text, MwNtext, "#FFFFFF");
+ MwSetString(picker->color_display_text, MwNbackground, "#FFFFFF");
+ MwSetString(picker->color_display_text, MwNtext, "#FFFFFF");
/* MwSetInteger(picker->color_display_text, Mwnali, MwALIGNMENT_CENTER); */
MwAddUserHandler(picker->color_display_text, MwNactivateHandler,
@@ -330,7 +330,7 @@ color_picker_t* color_picker_setup(MwWidget parent, int w, int h) {
picker->finish = MwCreateWidget(
MwButtonClass, "colorPickerFinish", picker->parent, IMG_POS_X(w),
IMG_POS_Y(h) + PICKER_SIZE + MARGIN, PICKER_SIZE, (WIN_SIZE - PICKER_SIZE - MARGIN * 4) / 2);
- MwSetText(picker->finish, MwNtext, "Select");
+ MwSetString(picker->finish, MwNtext, "Select");
MwSetInteger(picker->finish, MwNhasBorder, 1);
MwSetInteger(picker->finish, MwNinverted, 1);
diff --git a/src/dialog/filechooser.c b/src/dialog/filechooser.c
index 59666c64..03092876 100644
--- a/src/dialog/filechooser.c
+++ b/src/dialog/filechooser.c
@@ -105,7 +105,7 @@ static void MWAPI files_activate(MwWidget handle, void* user, void* call) {
static void MWAPI okay_activate(MwWidget handle, void* user, void* call) {
filechooser_t* fc = handle->parent->opaque;
- char* t = (char*)MwGetText(fc->filename, MwNtext);
+ char* t = (char*)MwGetString(fc->filename, MwNtext);
struct stat s;
char* p = NULL;
@@ -195,7 +195,7 @@ static void MWAPI addr_activate(MwWidget handle, void* user, void* call) {
(void)user;
(void)call;
- scan(handle->parent, MwGetText(handle, MwNtext), 1);
+ scan(handle->parent, MwGetString(handle, MwNtext), 1);
}
static void layout(MwWidget handle) {
diff --git a/src/draw.c b/src/draw.c
index ca3acec3..46d4a8b7 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -42,7 +42,7 @@ static void color_set_disabled_if_disabled(MwWidget handle, MwColor rgb) {
int n;
if((n = MwGetInteger(handle, MwNdisabled)) != MwDEFAULT && n) {
- MwColor c = handle->parent == NULL ? NULL : MwParseColor(handle->parent, MwGetText(handle->parent, MwNbackground));
+ MwColor c = handle->parent == NULL ? NULL : MwParseColor(handle->parent, MwGetString(handle->parent, MwNbackground));
if(c != NULL) {
rgb->common->red = (MwU8)(rgb->common->red + (c->common->red - rgb->common->red) * 0.5);
@@ -251,7 +251,7 @@ void MwDrawWidgetBack(MwWidget handle, MwRect* rect, MwColor color, int invert,
if(border) {
if(!handle->lowlevel->common.supports_transparency) {
- MwColor c = handle->parent == NULL ? NULL : MwParseColor(handle->parent, MwGetText(handle->parent, MwNbackground));
+ MwColor c = handle->parent == NULL ? NULL : MwParseColor(handle->parent, MwGetString(handle->parent, MwNbackground));
if(c != NULL) {
MwDrawRect(handle, rect, c);
@@ -403,7 +403,7 @@ void MwDrawCircle(MwWidget handle, MwRect* rect, MwColor color, MwColor backgrou
if(inside) {
MwColor mixColor;
- MwColor c = background ? background : (handle->parent == NULL ? NULL : MwParseColor(handle->parent, MwGetText(handle->parent, MwNbackground)));
+ MwColor c = background ? background : (handle->parent == NULL ? NULL : MwParseColor(handle->parent, MwGetString(handle->parent, MwNbackground)));
double mod;
unsigned char* pout = &data[(y * width + x) * 4];
@@ -990,7 +990,7 @@ MwPixmap MwLoadRaw(MwWidget handle, unsigned char* rgb, int width, int height) {
void MwPixmapReloadRaw(MwPixmap px, unsigned char* rgb) {
int i;
MwWidget handle = px->handle;
- MwColor base = handle->bgcolor == NULL ? MwParseColor(handle, MwGetText(handle, MwNbackground)) : handle->bgcolor;
+ MwColor base = handle->bgcolor == NULL ? MwParseColor(handle, MwGetString(handle, MwNbackground)) : handle->bgcolor;
if(rgb != NULL) memcpy(px->raw, rgb, px->common->width * px->common->height * 4);
@@ -1044,7 +1044,6 @@ void MwDestroyPixmap(MwPixmap pixmap) {
break;
}
}
-
if(arrlen(handle->pixmaps) == 0) handle->prop_inject_pixmap = NULL;
MwLLDestroyPixmap(pixmap->lowlevel);
@@ -1061,6 +1060,7 @@ MwColor MwAllocColor(MwWidget handle, unsigned int red, unsigned int green, unsi
color->lowlevel = MwLLAllocColor(handle->lowlevel, red, green, blue);
color->common = &color->lowlevel->common;
+ color->handle = handle;
return color;
}
@@ -1076,6 +1076,16 @@ void MwColorUpdate(MwColor c, int r, int g, int b) {
}
void MwFreeColor(MwColor color) {
+ int i;
+ MwWidget handle = color->handle;
+
+ for(i = 0; i < arrlen(handle->colors); i++) {
+ if(handle->colors[i] == color) {
+ arrdel(handle->colors, i);
+ break;
+ }
+ }
+
MwLLFreeColor(color->lowlevel);
free(color);
}
diff --git a/src/text/text.c b/src/text/text.c
index f7ebd402..cd01e852 100644
--- a/src/text/text.c
+++ b/src/text/text.c
@@ -85,7 +85,7 @@ void MwDrawText(MwWidget handle, MwFLFont ttf, MwPoint* point, const char* text,
int n;
if((n = MwGetInteger(handle, MwNdisabled)) != MwDEFAULT && n) {
- MwColor c = handle->parent == NULL ? NULL : MwParseColor(handle->parent, MwGetText(handle->parent, MwNbackground));
+ MwColor c = handle->parent == NULL ? NULL : MwParseColor(handle->parent, MwGetString(handle->parent, MwNbackground));
if(c != NULL) {
fadedColor = MwAllocColor(handle, color->common->red, color->common->blue, color->common->green);
diff --git a/src/widget/box.c b/src/widget/box.c
index 0f9c8f52..7df2447d 100644
--- a/src/widget/box.c
+++ b/src/widget/box.c
@@ -78,7 +78,7 @@ static void layout(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
r.x = 0;
r.y = 0;
diff --git a/src/widget/button.c b/src/widget/button.c
index 1df22469..35192e7e 100644
--- a/src/widget/button.c
+++ b/src/widget/button.c
@@ -15,9 +15,9 @@ static int wcreate(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
MwPoint point;
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
- MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
- const char* str = MwGetText(handle, MwNtext);
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
+ MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
+ const char* str = MwGetString(handle, MwNtext);
MwPixmap px = MwGetPointer(handle, MwNpixmap);
MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap);
int inv;
diff --git a/src/widget/calendar.c b/src/widget/calendar.c
index 7005558d..3e7dfaa2 100644
--- a/src/widget/calendar.c
+++ b/src/widget/calendar.c
@@ -81,8 +81,8 @@ static MwPixmap blit(MwWidget handle, const char* str, MwColor bg, MwColor fg, i
}
static void draw(MwWidget handle) {
- MwColor c = MwParseColor(handle, MwGetText(handle, MwNbackground));
- MwColor cf = MwParseColor(handle, MwGetText(handle, MwNforeground));
+ MwColor c = MwParseColor(handle, MwGetString(handle, MwNbackground));
+ MwColor cf = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwColor cb = MwParseColor(handle, "#fff");
MwColor cb_g = MwParseColor(handle, "#666");
MwColor ct = MwParseColor(handle, "#000");
diff --git a/src/widget/chart.c b/src/widget/chart.c
index 6a9bba9e..dce3bb32 100644
--- a/src/widget/chart.c
+++ b/src/widget/chart.c
@@ -395,8 +395,8 @@ static void line_chart(MwWidget handle, MwRect* _r, double vmin, double vmax, in
}
static void draw(MwWidget handle) {
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
- MwColor border = MwParseColor(handle, MwGetText(handle, MwNforeground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
+ MwColor border = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwRect r;
MwChart c = handle->internal;
int i;
diff --git a/src/widget/checkbox.c b/src/widget/checkbox.c
index 2b29ac65..44807079 100644
--- a/src/widget/checkbox.c
+++ b/src/widget/checkbox.c
@@ -10,9 +10,9 @@ static int wcreate(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
- MwColor base2 = MwParseColor(handle, MwGetText(handle, MwNsubBackground));
- MwColor text2 = MwParseColor(handle, MwGetText(handle, MwNsubForeground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
+ MwColor base2 = MwParseColor(handle, MwGetString(handle, MwNsubBackground));
+ MwColor text2 = MwParseColor(handle, MwGetString(handle, MwNsubForeground));
MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap);
r.x = 0;
diff --git a/src/widget/clock.c b/src/widget/clock.c
index 6e03a4c8..3356776e 100644
--- a/src/widget/clock.c
+++ b/src/widget/clock.c
@@ -55,10 +55,10 @@ static void draw(MwWidget handle) {
int ColorDiff = MwGetColorDifference(handle);
int ShadowDist;
int BaseWidth;
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor shadow = MwLightenColor(handle, base, -ColorDiff, -ColorDiff, -ColorDiff);
- MwColor inside = MwParseColor(handle, MwGetText(handle, MwNsubBackground));
- MwColor border = MwParseColor(handle, MwGetText(handle, MwNsubForeground));
+ MwColor inside = MwParseColor(handle, MwGetString(handle, MwNsubBackground));
+ MwColor border = MwParseColor(handle, MwGetString(handle, MwNsubForeground));
MwRect r;
int i;
double w;
diff --git a/src/widget/combobox.c b/src/widget/combobox.c
index 36f2e6c5..a098714a 100644
--- a/src/widget/combobox.c
+++ b/src/widget/combobox.c
@@ -25,8 +25,8 @@ static void destroy(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r, rc;
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
- MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
+ MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwComboBox cb = handle->internal;
r.x = 0;
diff --git a/src/widget/document.c b/src/widget/document.c
index 045605f4..505a26da 100644
--- a/src/widget/document.c
+++ b/src/widget/document.c
@@ -52,8 +52,8 @@ static void destroy(MwWidget handle) {
static void draw(MwWidget handle) {
MwDocument d = handle->internal;
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
- MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
+ MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwRect r;
int i;
MwFLFont font = NULL;
@@ -634,7 +634,7 @@ static void prop_change(MwWidget handle, const char* key) {
if(strcmp(key, MwNtext) == 0) {
MD_PARSER parser;
- const char* str = MwGetText(handle, MwNtext);
+ const char* str = MwGetString(handle, MwNtext);
memset(&parser, 0, sizeof(parser));
diff --git a/src/widget/entry.c b/src/widget/entry.c
index 305545c1..3638323a 100644
--- a/src/widget/entry.c
+++ b/src/widget/entry.c
@@ -47,9 +47,9 @@ static void tick(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
MwEntry t = handle->internal;
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
- MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
- const char* str = MwGetText(handle, MwNtext);
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
+ MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
+ const char* str = MwGetString(handle, MwNtext);
MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap);
MwFLFont font = MwFLBuildFont(MwFLFlagMonospace);
if(str == NULL) str = "";
@@ -114,7 +114,7 @@ static void draw(MwWidget handle) {
static void key(MwWidget handle, int code) {
MwEntry t = handle->internal;
- const char* str = MwGetText(handle, MwNtext);
+ const char* str = MwGetString(handle, MwNtext);
char* out;
if(str == NULL) str = "";
@@ -127,7 +127,7 @@ static void key(MwWidget handle, int code) {
MwUTF8Copy(str, 0, out, 0, t->cursor);
MwUTF8Copy(str, t->cursor + 1, out, t->cursor, MwUTF8Length(str) - (t->cursor + 1));
- MwSetText(handle, MwNtext, out);
+ MwSetString(handle, MwNtext, out);
MwDispatchUserHandler(handle, MwNchangedHandler, NULL);
free(out);
@@ -150,13 +150,13 @@ static void key(MwWidget handle, int code) {
t->cursor++;
- MwSetText(handle, MwNtext, out);
+ MwSetString(handle, MwNtext, out);
MwDispatchUserHandler(handle, MwNchangedHandler, NULL);
free(out);
}
- if(MwGetText(handle, MwNtext) != NULL) t->length = MwUTF8Length(MwGetText(handle, MwNtext));
+ if(MwGetString(handle, MwNtext) != NULL) t->length = MwUTF8Length(MwGetString(handle, MwNtext));
MwForceRender(handle);
}
@@ -199,7 +199,7 @@ static void prop_change(MwWidget handle, const char* prop) {
if(strcmp(prop, MwNtext) == 0) {
MwEntry t = handle->internal;
- int len = MwUTF8Length(MwGetText(handle, MwNtext));
+ int len = MwUTF8Length(MwGetString(handle, MwNtext));
if(len < t->cursor) {
t->cursor = len;
} else if(t->length == t->cursor) {
@@ -211,7 +211,7 @@ static void prop_change(MwWidget handle, const char* prop) {
static void clipboard(MwWidget handle, const char* data) {
MwEntry t = handle->internal;
- const char* str = MwGetText(handle, MwNtext);
+ const char* str = MwGetString(handle, MwNtext);
char* out;
if(!str) {
str = "";
@@ -226,7 +226,7 @@ static void clipboard(MwWidget handle, const char* data) {
t->cursor += MwUTF8Length(data);
- MwSetText(handle, MwNtext, out);
+ MwSetString(handle, MwNtext, out);
free(out);
MwForceRender(handle);
diff --git a/src/widget/frame.c b/src/widget/frame.c
index 5ed79f52..ddff2043 100644
--- a/src/widget/frame.c
+++ b/src/widget/frame.c
@@ -12,7 +12,7 @@ static int wcreate(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect fr;
MwRect rr;
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
int inverted;
MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap);
diff --git a/src/widget/image.c b/src/widget/image.c
index 6d5423b5..016b4b38 100644
--- a/src/widget/image.c
+++ b/src/widget/image.c
@@ -13,7 +13,7 @@ static int wcreate(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
MwPixmap px = MwGetPointer(handle, MwNpixmap);
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
r.x = 0;
r.y = 0;
diff --git a/src/widget/label.c b/src/widget/label.c
index e11fcc40..1220e211 100644
--- a/src/widget/label.c
+++ b/src/widget/label.c
@@ -124,11 +124,11 @@ static void draw_h(MwWidget handle, unsigned char* raw, int x, int y, int stride
static void draw_seven_segment(MwWidget handle) {
MwRect r;
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
- MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
+ MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwColor shadow = MwLightenColor(handle, base, MwDefaultShadow, MwDefaultShadow, MwDefaultShadow);
int align;
- const char* str = MwGetText(handle, MwNtext);
+ const char* str = MwGetString(handle, MwNtext);
MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap);
MwLabel lab = handle->internal;
int l_one = MwGetInteger(handle, MwNlength) - (MwGetInteger(handle, MwNlength) % 2);
@@ -315,11 +315,11 @@ static void draw_seven_segment(MwWidget handle) {
static void draw_normal(MwWidget handle) {
MwRect r;
MwPoint p;
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
- MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
+ MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwColor shadow = MwLightenColor(handle, base, MwDefaultShadow, MwDefaultShadow, MwDefaultShadow);
int align;
- const char* str = MwGetText(handle, MwNtext);
+ const char* str = MwGetString(handle, MwNtext);
MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap);
if(str == NULL) str = "";
diff --git a/src/widget/listbox.c b/src/widget/listbox.c
index 272909e0..68daec18 100644
--- a/src/widget/listbox.c
+++ b/src/widget/listbox.c
@@ -136,10 +136,10 @@ static void MWAPI frame_mouse_move(MwWidget handle, void* user, void* call) {
static void frame_draw(MwWidget handle) {
MwRect r, r2;
MwListBox lb = handle->parent->internal;
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
- MwColor base2 = MwParseColor(handle, MwGetText(handle, MwNsubBackground));
- MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
- MwColor text2 = MwParseColor(handle, MwGetText(handle, MwNsubForeground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
+ MwColor base2 = MwParseColor(handle, MwGetString(handle, MwNsubBackground));
+ MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
+ MwColor text2 = MwParseColor(handle, MwGetString(handle, MwNsubForeground));
int i;
MwPoint p;
int st = 0;
@@ -359,8 +359,8 @@ static void destroy(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
- MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
+ MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwListBox lb = handle->internal;
r.x = 0;
diff --git a/src/widget/menu.c b/src/widget/menu.c
index 22771e9b..7d2f284b 100644
--- a/src/widget/menu.c
+++ b/src/widget/menu.c
@@ -103,8 +103,8 @@ static void destroy(MwWidget handle) {
m->sub[i]->cleaned = 0;
static void draw(MwWidget handle) {
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
- MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
+ MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MENU_LOOP_DECL;
MENU_LOOP_INIT;
diff --git a/src/widget/numberentry.c b/src/widget/numberentry.c
index d0323e51..2b1d54f1 100644
--- a/src/widget/numberentry.c
+++ b/src/widget/numberentry.c
@@ -9,7 +9,7 @@ static int wcreate(MwWidget handle) {
e = handle->internal;
e->right = 32;
- MwSetText(handle, MwNtext, "0");
+ MwSetString(handle, MwNtext, "0");
return 0;
}
@@ -24,7 +24,7 @@ static void draw(MwWidget handle) {
MwEntry e = handle->internal;
MwRect r;
int pr;
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwEntryClass->draw(handle);
@@ -65,7 +65,7 @@ static void draw(MwWidget handle) {
static void key(MwWidget handle, int code) {
MwEntry e = handle->internal;
- const char* str = MwGetText(handle, MwNtext);
+ const char* str = MwGetString(handle, MwNtext);
int ok = 0;
if(str == NULL) str = "";
@@ -96,7 +96,7 @@ static void mouse_up(MwWidget handle, void* ptr) {
MwEntry e = handle->internal;
int w = MwGetInteger(handle, MwNwidth);
int h = MwGetInteger(handle, MwNheight);
- const char* str = MwGetText(handle, MwNtext);
+ const char* str = MwGetString(handle, MwNtext);
if(((MwMouse*)ptr)->button != MwMOUSE_LEFT) return;
@@ -107,7 +107,7 @@ static void mouse_up(MwWidget handle, void* ptr) {
} else {
MwStringPrintIntoBuffer(s, 512, "%g", atof(str) + 1);
}
- MwSetText(handle, MwNtext, s);
+ MwSetString(handle, MwNtext, s);
MwDispatchUserHandler(handle, MwNchangedHandler, NULL);
}
diff --git a/src/widget/progressbar.c b/src/widget/progressbar.c
index 879bd42e..a26e902b 100644
--- a/src/widget/progressbar.c
+++ b/src/widget/progressbar.c
@@ -13,8 +13,8 @@ static int wcreate(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
- MwColor fill = MwParseColor(handle, MwGetText(handle, MwNforeground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
+ MwColor fill = MwParseColor(handle, MwGetString(handle, MwNforeground));
double w;
MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap);
diff --git a/src/widget/radiobox.c b/src/widget/radiobox.c
index 475991fe..2abe27e6 100644
--- a/src/widget/radiobox.c
+++ b/src/widget/radiobox.c
@@ -12,7 +12,7 @@ static int wcreate(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap);
r.x = 0;
diff --git a/src/widget/scrollbar.c b/src/widget/scrollbar.c
index 613868bd..840cdb56 100644
--- a/src/widget/scrollbar.c
+++ b/src/widget/scrollbar.c
@@ -55,7 +55,7 @@ static void add_value(MwWidget handle, int mul) {
static void draw(MwWidget handle) {
MwRect r = {0}, rt = {0}, rbar = {0};
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor dark = MwLightenColor(handle, base, -64, -64, -64);
MwScrollBar scr = handle->internal;
int or ;
diff --git a/src/widget/separator.c b/src/widget/separator.c
index 84af1a3d..5baa2133 100644
--- a/src/widget/separator.c
+++ b/src/widget/separator.c
@@ -10,7 +10,7 @@ static int wcreate(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
r.x = 0;
r.y = 0;
diff --git a/src/widget/submenu.c b/src/widget/submenu.c
index e76f0fba..7ab48ff6 100644
--- a/src/widget/submenu.c
+++ b/src/widget/submenu.c
@@ -29,8 +29,8 @@ static void destroy(MwWidget handle) {
}
static void draw(MwWidget handle) {
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
- MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
+ MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwRect r;
MwMenu menu = handle->internal;
diff --git a/src/widget/subwindow.c b/src/widget/subwindow.c
index 37c7b14a..0fee158c 100644
--- a/src/widget/subwindow.c
+++ b/src/widget/subwindow.c
@@ -11,7 +11,7 @@ static void close_draw(MwWidget handle) {
int w = MwGetInteger(handle, MwNwidth);
int h = MwGetInteger(handle, MwNheight);
MwPoint p[2];
- MwColor c = MwParseColor(handle, MwGetText(handle, MwNforeground));
+ MwColor c = MwParseColor(handle, MwGetString(handle, MwNforeground));
int bw = MwDefaultBorderWidth(handle);
p[0].x = bw * 2;
@@ -52,7 +52,7 @@ static void maximize_draw(MwWidget handle) {
int w = MwGetInteger(handle, MwNwidth);
int h = MwGetInteger(handle, MwNheight);
MwPoint p[2];
- MwColor c = MwParseColor(handle, MwGetText(handle, MwNforeground));
+ MwColor c = MwParseColor(handle, MwGetString(handle, MwNforeground));
int bw = MwDefaultBorderWidth(handle);
p[0].x = bw * 2;
@@ -117,7 +117,7 @@ static void minimize_draw(MwWidget handle) {
int w = MwGetInteger(handle, MwNwidth);
int h = MwGetInteger(handle, MwNheight);
MwPoint p[2];
- MwColor c = MwParseColor(handle, MwGetText(handle, MwNforeground));
+ MwColor c = MwParseColor(handle, MwGetString(handle, MwNforeground));
int bw = MwDefaultBorderWidth(handle);
p[0].x = bw * 2;
@@ -285,11 +285,11 @@ static void destroy(MwWidget handle) {
}
static void draw(MwWidget handle) {
- MwColor c = MwParseColor(handle, MwGetText(handle, MwNbackground));
- MwColor tb = MwParseColor(handle, MwGetText(handle, MwNtitleBackground));
- MwColor tf = MwParseColor(handle, MwGetText(handle, MwNtitleForeground));
+ MwColor c = MwParseColor(handle, MwGetString(handle, MwNbackground));
+ MwColor tb = MwParseColor(handle, MwGetString(handle, MwNtitleBackground));
+ MwColor tf = MwParseColor(handle, MwGetString(handle, MwNtitleForeground));
MwRect r, r2, r3;
- const char* title = MwGetText(handle, MwNtitle);
+ const char* title = MwGetString(handle, MwNtitle);
int incr = 0;
MwPixmap px = MwGetPointer(handle, MwNiconPixmap);
diff --git a/src/widget/tab.c b/src/widget/tab.c
index 3ae47dc2..3a630cec 100644
--- a/src/widget/tab.c
+++ b/src/widget/tab.c
@@ -58,8 +58,8 @@ static int icon_width(MwWidget handle, const char* text) {
static void draw(MwWidget handle) {
MwTab t = handle->internal;
- MwColor c = MwParseColor(handle, MwGetText(handle, MwNbackground));
- MwColor ct = MwParseColor(handle, MwGetText(handle, MwNforeground));
+ MwColor c = MwParseColor(handle, MwGetString(handle, MwNbackground));
+ MwColor ct = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwRect r, r2;
int h = tab_height(handle);
int i;
diff --git a/src/widget/treeview.c b/src/widget/treeview.c
index 55bc916e..0ebaf852 100644
--- a/src/widget/treeview.c
+++ b/src/widget/treeview.c
@@ -167,10 +167,10 @@ static void recursion(MwWidget handle, MwTreeViewEntry* tree, MwTreeViewEntry**
static void frame_draw(MwWidget handle) {
MwRect r, r2;
MwTreeView tv = handle->parent->internal;
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
- MwColor base2 = MwParseColor(handle, MwGetText(handle, MwNsubBackground));
- MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
- MwColor text2 = MwParseColor(handle, MwGetText(handle, MwNsubForeground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
+ MwColor base2 = MwParseColor(handle, MwGetString(handle, MwNsubBackground));
+ MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
+ MwColor text2 = MwParseColor(handle, MwGetString(handle, MwNsubForeground));
MwPoint p;
int shared = 0;
int i;
@@ -322,7 +322,7 @@ static void destroy(MwWidget handle) {
}
static void draw(MwWidget handle) {
- MwColor c = MwParseColor(handle, MwGetText(handle, MwNbackground));
+ MwColor c = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwRect r;
r.x = 0;
diff --git a/src/widget/viewport.c b/src/widget/viewport.c
index 8f673a98..4255cafd 100644
--- a/src/widget/viewport.c
+++ b/src/widget/viewport.c
@@ -102,7 +102,7 @@ static void destroy(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
- MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
+ MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
r.x = 0;
r.y = 0;
diff --git a/src/widget/vulkan.c b/src/widget/vulkan.c
index a57e142b..59c3880b 100644
--- a/src/widget/vulkan.c
+++ b/src/widget/vulkan.c
@@ -568,11 +568,11 @@ static void prop_change(MwWidget handle, const char* prop) {
}
if(strcmp(prop, MwNvulkanExtension) == 0) {
- char* str = MwStringDuplicate(MwGetText(handle, MwNvulkanExtension));
+ char* str = MwStringDuplicate(MwGetString(handle, MwNvulkanExtension));
arrput(o->enabledExtensions, str);
} else if(strcmp(prop, MwNvulkanLayer) == 0) {
- char* str = MwStringDuplicate(MwGetText(handle, MwNvulkanExtension));
+ char* str = MwStringDuplicate(MwGetString(handle, MwNvulkanExtension));
arrput(o->enabledLayers, str);
} else if(strcmp(prop, MwNvulkanConfig) == 0) {
diff --git a/src/widget/window.c b/src/widget/window.c
index 3bf3e763..bcce35a7 100644
--- a/src/widget/window.c
+++ b/src/widget/window.c
@@ -10,7 +10,7 @@ static int wcreate(MwWidget handle) {
}
static void draw(MwWidget handle) {
- MwColor c = MwParseColor(handle, MwGetText(handle, MwNbackground));
+ MwColor c = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwRect r;
r.x = 0;