forked from pyrite-dev/milsko
wayland
This commit is contained in:
parent
ad49a55812
commit
bf5ab45f2e
6 changed files with 57 additions and 5 deletions
39
examples/basic/tab.c
Normal file
39
examples/basic/tab.c
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#include <Mw/Milsko.h>
|
||||
|
||||
MwWidget tab;
|
||||
|
||||
static void MWAPI resize(MwWidget handle, void* user, void* client) {
|
||||
MwVaApply(tab,
|
||||
MwNwidth, MwGetInteger(handle, MwNwidth),
|
||||
MwNheight, MwGetInteger(handle, MwNheight),
|
||||
NULL);
|
||||
}
|
||||
|
||||
int main() {
|
||||
MwWidget w;
|
||||
int i;
|
||||
MwLLPixmap px[6];
|
||||
|
||||
MwLibraryInit();
|
||||
|
||||
w = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 800, 600,
|
||||
MwNtitle, "subwindow",
|
||||
NULL);
|
||||
|
||||
tab = MwCreateWidget(MwTabClass, "tab", w, 0, 0, 800, 600);
|
||||
|
||||
for(i = 0; i < 16; i++) {
|
||||
char buf[32];
|
||||
MwWidget sw, f, img;
|
||||
|
||||
sprintf(buf, "Tab %d", i);
|
||||
|
||||
MwTabAdd(tab, buf);
|
||||
}
|
||||
|
||||
MwAddUserHandler(w, MwNresizeHandler, resize, NULL);
|
||||
|
||||
resize(w, NULL, NULL);
|
||||
|
||||
MwLoop(w);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue