add the example

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@224 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-10-08 15:20:22 +00:00
parent 328023cfe1
commit c4dd26ecd2
2 changed files with 26 additions and 1 deletions

View File

@@ -133,7 +133,7 @@ else
L_CFLAGS += -DUSE_STB_IMAGE L_CFLAGS += -DUSE_STB_IMAGE
endif endif
EXAMPLES = examples/example$(EXEC) examples/rotate$(EXEC) examples/image$(EXEC) examples/scrollbar$(EXEC) EXAMPLES = examples/example$(EXEC) examples/rotate$(EXEC) examples/image$(EXEC) examples/scrollbar$(EXEC) examples/checkbox$(EXEC)
ifeq ($(OPENGL),1) ifeq ($(OPENGL),1)
L_OBJS += src/widget/opengl.o L_OBJS += src/widget/opengl.o

25
examples/checkbox.c Normal file
View File

@@ -0,0 +1,25 @@
/* $Id$ */
#include <Mw/Milsko.h>
int main() {
MwWidget window = MwVaCreateWidget(MwWindowClass, "test", NULL, 0, 0, 8 + 16 + 8 + 16 * 10 + 8, 8 + 16 + 8 + 16 + 8,
MwNtitle, "checkbox",
NULL);
MwVaCreateWidget(MwCheckBoxClass, "cb1", window, 8, 8, 16, 16,
NULL);
MwVaCreateWidget(MwCheckBoxClass, "cb2", window, 8, 8 + 16 + 8, 16, 16,
MwNchecked, 1,
NULL);
MwVaCreateWidget(MwLabelClass, "lab1", window, 8 + 16 + 8, 8, 16 * 10, 16,
MwNtext, "lorem ipsum 1",
MwNalignment, MwALIGNMENT_BEGINNING,
NULL);
MwVaCreateWidget(MwLabelClass, "lab2", window, 8 + 16 + 8, 8 + 16 + 8, 16 * 10, 16,
MwNtext, "lorem ipsum 2",
MwNalignment, MwALIGNMENT_BEGINNING,
NULL);
MwLoop(window);
}