mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-06 09:29:44 +00:00
give widgets a name
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@22 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -11,9 +11,12 @@ static void llhandler(MilskoLL handle) {
|
||||
Dispatch(h, draw);
|
||||
}
|
||||
|
||||
MilskoWidget MilskoCreateWidget(MilskoClass class, MilskoWidget parent, int x, int y, unsigned int width, unsigned int height) {
|
||||
MilskoWidget MilskoCreateWidget(MilskoClass class, const char* name, MilskoWidget parent, int x, int y, unsigned int width, unsigned int height) {
|
||||
MilskoWidget h = malloc(sizeof(*h));
|
||||
|
||||
h->name = malloc(strlen(name) + 1);
|
||||
strcpy(h->name, name);
|
||||
|
||||
h->parent = parent;
|
||||
h->children = NULL;
|
||||
h->lowlevel = MilskoLLCreate(parent == NULL ? NULL : parent->lowlevel, x, y, width, height);
|
||||
@@ -40,6 +43,8 @@ void MilskoDestroyWidget(MilskoWidget handle) {
|
||||
|
||||
Dispatch(handle, destroy);
|
||||
|
||||
free(handle->name);
|
||||
|
||||
if(handle->children != NULL) {
|
||||
for(i = 0; i < arrlen(handle->children); i++) {
|
||||
if(handle->children[i] == handle) {
|
||||
|
||||
Reference in New Issue
Block a user