mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-06 01:19:44 +00:00
basic stuff
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@11 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
23
src/core.c
23
src/core.c
@@ -8,10 +8,10 @@ HMILSKO MilskoCreateWidget(MilskoClass class, HMILSKO parent, int x, int y, unsi
|
||||
|
||||
h->parent = parent;
|
||||
h->children = NULL;
|
||||
h->lowlevel = MilskoLLCreate(parent->lowlevel, x, y, width, height);
|
||||
h->lowlevel = MilskoLLCreate(parent == NULL ? NULL : parent->lowlevel, x, y, width, height);
|
||||
h->class = class;
|
||||
|
||||
arrput(parent->children, h);
|
||||
if(parent != NULL) arrput(parent->children, h);
|
||||
|
||||
return h;
|
||||
}
|
||||
@@ -40,3 +40,22 @@ void MilskoDestroyWidget(HMILSKO handle) {
|
||||
MilskoLLDestroy(handle->lowlevel);
|
||||
free(handle);
|
||||
}
|
||||
|
||||
MILSKODECL void MilskoStep(HMILSKO handle){
|
||||
MilskoLLNextEvent(handle->lowlevel);
|
||||
}
|
||||
|
||||
MILSKODECL int MilskoPending(HMILSKO handle){
|
||||
int i;
|
||||
for(i = 0; i < arrlen(handle->children); i++){
|
||||
if(MilskoPending(handle->children[i])) return 1;
|
||||
}
|
||||
return MilskoLLPending(handle->lowlevel);
|
||||
}
|
||||
|
||||
MILSKODECL void MilskoLoop(HMILSKO handle){
|
||||
while(1){
|
||||
MilskoStep(handle);
|
||||
MilskoLLSleep(10);
|
||||
}
|
||||
}
|
||||
|
||||
6
src/window.c
Normal file
6
src/window.c
Normal file
@@ -0,0 +1,6 @@
|
||||
/* $Id$ */
|
||||
#include <Milsko/Milsko.h>
|
||||
|
||||
MilskoClassRec MilskoWindowClassRec = {
|
||||
};
|
||||
MilskoClass MilskoWindowClass = &MilskoWindowClassRec;
|
||||
Reference in New Issue
Block a user