From 7aa8438595383f43f783ad9e1c6c668de108f683 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Sun, 28 Sep 2025 13:53:35 +0000 Subject: [PATCH] h git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@27 b9cfdab3-6d41-4d17-bbe4-086880011989 --- include/Milsko/Core.h | 1 + include/Milsko/X11.h | 3 +++ src/button.c | 2 ++ src/core.c | 4 ++++ src/window.c | 2 +- src/x11.c | 3 +++ 6 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/Milsko/Core.h b/include/Milsko/Core.h index 3d009edb..f6b15be7 100644 --- a/include/Milsko/Core.h +++ b/include/Milsko/Core.h @@ -16,6 +16,7 @@ MILSKODECL void MilskoSetInteger(MilskoWidget handle, const char* key, in MILSKODECL void MilskoSetText(MilskoWidget handle, const char* key, const char* value); MILSKODECL int MilskoGetInteger(MilskoWidget handle, const char* key); MILSKODECL const char* MilskoGetText(MilskoWidget handle, const char* key); +MILSKODECL void MilskoSetDefault(MilskoWidget handle); MILSKODECL void MilskoApply(MilskoWidget handle, ...); #endif diff --git a/include/Milsko/X11.h b/include/Milsko/X11.h index 8c4bea12..2fc7688d 100644 --- a/include/Milsko/X11.h +++ b/include/Milsko/X11.h @@ -27,6 +27,9 @@ typedef struct _MilskoLowLevel { typedef struct _MilskoColor { unsigned long pixel; + int red; + int green; + int blue; }* MilskoLLColor; #endif diff --git a/src/button.c b/src/button.c index 204c9cc1..5e4a4c5f 100644 --- a/src/button.c +++ b/src/button.c @@ -2,9 +2,11 @@ #include static void create(MilskoWidget handle) { + MilskoSetDefault(handle); } static void draw(MilskoWidget handle) { + MilskoPoint p[6]; } MilskoClassRec MilskoButtonClassRec = { diff --git a/src/core.c b/src/core.c index b2d26355..6d4c7f79 100644 --- a/src/core.c +++ b/src/core.c @@ -162,3 +162,7 @@ void MilskoApply(MilskoWidget handle, ...) { } va_end(va); } + +void MilskoSetDefault(MilskoWidget handle) { + MilskoSetText(handle, MilskoNbackground, MilskoDefaultBackground); +} diff --git a/src/window.c b/src/window.c index 68600ce0..ea679836 100644 --- a/src/window.c +++ b/src/window.c @@ -2,7 +2,7 @@ #include static void create(MilskoWidget handle) { - MilskoSetText(handle, MilskoNbackground, MilskoDefaultBackground); + MilskoSetDefault(handle); } static void draw(MilskoWidget handle) { diff --git a/src/x11.c b/src/x11.c index 29a3c512..3c556978 100644 --- a/src/x11.c +++ b/src/x11.c @@ -63,6 +63,9 @@ MilskoLLColor MilskoLLAllocColor(MilskoLL handle, int r, int g, int b) { XAllocColor(handle->display, handle->colormap, &xc); c->pixel = xc.pixel; + c->red = r; + c->green = g; + c->blue = b; return c; }