add MwLibraryInit

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@680 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-11-13 01:30:10 +00:00
parent a5db4f8eac
commit b0ea597d62
27 changed files with 263 additions and 350 deletions

View File

@@ -2,7 +2,11 @@
#include <Mw/Milsko.h>
int main() {
MwWidget window = MwVaCreateWidget(MwWindowClass, "test", NULL, MwDEFAULT, MwDEFAULT, 8 + 16 + 8 + 16 * 10 + 8, 8 + 16 + 8 + 16 + 8,
MwWidget window;
MwLibraryInit();
window = MwVaCreateWidget(MwWindowClass, "test", NULL, MwDEFAULT, MwDEFAULT, 8 + 16 + 8 + 16 * 10 + 8, 8 + 16 + 8 + 16 + 8,
MwNtitle, "checkbox",
NULL);

View File

@@ -33,6 +33,8 @@ void color_picker(MwWidget handle, void* user_data, void* call_data) {
}
int main() {
MwLibraryInit();
window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT,
MwDEFAULT, 640, 480, MwNtitle, "color picker", NULL);
MwSetText(window, MwNbackground, "#000000");

View File

@@ -58,6 +58,8 @@ void resize(MwWidget handle, void* user_data, void* call_data) {
int main() {
MwMenu m, m2;
MwLibraryInit();
window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 400, 400,
MwNtitle, "hello world",
NULL);

View File

@@ -2,15 +2,20 @@
#include <Mw/Milsko.h>
int main() {
MwWidget window = MwVaCreateWidget(MwWindowClass, "window", NULL, MwDEFAULT, MwDEFAULT, 500, 500,
MwWidget window, image, image2, image3;
MwLLPixmap px, px2, px3;
MwLibraryInit();
window = MwVaCreateWidget(MwWindowClass, "window", NULL, MwDEFAULT, MwDEFAULT, 500, 500,
MwNtitle, "image image",
NULL);
MwWidget image = MwCreateWidget(MwImageClass, "image", window, 50, 50, 200, 400);
MwWidget image2 = MwCreateWidget(MwImageClass, "image", window, 250, 50, 200, 200);
MwWidget image3 = MwCreateWidget(MwImageClass, "image", window, 250, 250, 200, 200);
MwLLPixmap px = MwLoadImage(window, "examples/picture.png");
MwLLPixmap px2 = MwLoadImage(window, "examples/picture.jpg");
MwLLPixmap px3 = MwLoadImage(window, "resource/logo/logo.png");
image = MwCreateWidget(MwImageClass, "image", window, 50, 50, 200, 400);
image2 = MwCreateWidget(MwImageClass, "image", window, 250, 50, 200, 200);
image3 = MwCreateWidget(MwImageClass, "image", window, 250, 250, 200, 200);
px = MwLoadImage(window, "examples/picture.png");
px2 = MwLoadImage(window, "examples/picture.jpg");
px3 = MwLoadImage(window, "resource/logo/logo.png");
if(px == NULL) px = MwLoadImage(window, "../examples/picture.png");
if(px2 == NULL) px2 = MwLoadImage(window, "../examples/picture.jpg");

View File

@@ -29,6 +29,9 @@ int main() {
int i;
MwListBoxPacket* packet;
int index;
MwLibraryInit();
wmain = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 640, 480,
MwNtitle, "listbox",
NULL);

View File

@@ -38,10 +38,14 @@ void spawn3(MwWidget handle, void* user, void* call) {
}
int main() {
MwWidget msg = MwVaCreateWidget(MwWindowClass, "test", NULL, MwDEFAULT, MwDEFAULT, 300, 100, MwNtitle, "test", NULL);
MwWidget btn = MwVaCreateWidget(MwButtonClass, "button", msg, 8, 8, 300 - 16, (100 - 16) / 2, MwNtext, "press me!", NULL);
MwWidget btn2 = MwVaCreateWidget(MwButtonClass, "button", msg, 8, 8 + (100 - 16) / 2, (300 - 16) / 2, (100 - 16) / 2, MwNtext, "press me!", NULL);
MwWidget btn3 = MwVaCreateWidget(MwButtonClass, "button", msg, 8 + (300 - 16) / 2, 8 + (100 - 16) / 2, (300 - 16) / 2, (100 - 16) / 2, MwNtext, "press me!", NULL);
MwWidget msg, btn, btn2, btn3;
MwLibraryInit();
msg = MwVaCreateWidget(MwWindowClass, "test", NULL, MwDEFAULT, MwDEFAULT, 300, 100, MwNtitle, "test", NULL);
btn = MwVaCreateWidget(MwButtonClass, "button", msg, 8, 8, 300 - 16, (100 - 16) / 2, MwNtext, "press me!", NULL);
btn2 = MwVaCreateWidget(MwButtonClass, "button", msg, 8, 8 + (100 - 16) / 2, (300 - 16) / 2, (100 - 16) / 2, MwNtext, "press me!", NULL);
btn3 = MwVaCreateWidget(MwButtonClass, "button", msg, 8 + (300 - 16) / 2, 8 + (100 - 16) / 2, (300 - 16) / 2, (100 - 16) / 2, MwNtext, "press me!", NULL);
MwAddUserHandler(btn, MwNactivateHandler, spawn, msg);
MwAddUserHandler(btn2, MwNactivateHandler, spawn2, msg);

View File

@@ -1,10 +1,14 @@
#include <Mw/Milsko.h>
int main() {
MwWidget w = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 5 + 640 + 5, 5 + 32 + 5,
MwWidget w, p;
MwLibraryInit();
w = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 5 + 640 + 5, 5 + 32 + 5,
MwNtitle, "progress bar",
NULL);
MwWidget p = MwVaCreateWidget(MwProgressBarClass, "progress", w, 5, 5, 640, 32,
p = MwVaCreateWidget(MwProgressBarClass, "progress", w, 5, 5, 640, 32,
MwNvalue, 25,
NULL);

View File

@@ -2,7 +2,11 @@
#include <Mw/Milsko.h>
int main() {
MwWidget window = MwVaCreateWidget(MwWindowClass, "test", NULL, MwDEFAULT, MwDEFAULT, 8 + 16 + 8 + 16 * 10 + 8, 8 + 16 + 8 + 16 + 8,
MwWidget window;
MwLibraryInit();
window = MwVaCreateWidget(MwWindowClass, "test", NULL, MwDEFAULT, MwDEFAULT, 8 + 16 + 8 + 16 * 10 + 8, 8 + 16 + 8 + 16 + 8,
MwNtitle, "radiobox",
NULL);

View File

@@ -55,10 +55,14 @@ void resize(MwWidget w, void* user, void* client) {
}
int main() {
MwWidget window = MwVaCreateWidget(MwWindowClass, "window", NULL, MwDEFAULT, MwDEFAULT, (ww = 500), (wh = 500),
MwWidget window;
int i;
MwLibraryInit();
window = MwVaCreateWidget(MwWindowClass, "window", NULL, MwDEFAULT, MwDEFAULT, (ww = 500), (wh = 500),
MwNtitle, "rotate",
NULL);
int i;
for(i = 0; i < (int)(sizeof(buttons) / sizeof(buttons[0])); i++) {
const char* color = "";

View File

@@ -3,10 +3,14 @@
#include <Mw/Milsko.h>
int main() {
MwWidget window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 500, 500,
MwWidget window;
int i;
MwLibraryInit();
window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 500, 500,
MwNtitle, "main",
NULL);
int i;
for(i = 0; i < 500 / 16; i++) {
MwVaCreateWidget(MwScrollBarClass, "scroll", window, 16 * i, 0, 16, 500,

View File

@@ -17,9 +17,13 @@ static void resize(MwWidget handle, void* user, void* call) {
}
int main() {
MwWidget w = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 640, 480, MwNtitle, "test", NULL);
MwWidget w;
MwLLPixmap px;
MwLibraryInit();
w = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 640, 480, MwNtitle, "test", NULL);
vp = MwCreateWidget(MwViewportClass, "vp", w, 5, 5, 630, 470);
px = MwLoadImage(vp, "examples/picture.png");