treeview works

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@766 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-11-21 16:16:08 +00:00
parent 9dee24f7bc
commit 38b5876fba
4 changed files with 79 additions and 13 deletions

View File

@@ -22,6 +22,7 @@ void activate(MwWidget handle, void* user, void* call) {
int main(){
MwWidget tv;
MwLLPixmap px;
int i;
void* p = NULL, *r;
@@ -30,11 +31,19 @@ int main(){
wmain = MwCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 5 + 640 + 5, 5 + 480 + 5);
tv = MwCreateWidget(MwTreeViewClass, "tree", wmain, 5, 5, 640, 480);
px = MwLoadIcon(tv, MwIconInfo);
MwSetInteger(tv, MwNleftPadding, 16);
MwAddUserHandler(tv, MwNactivateHandler, activate, NULL);
for(i = 0; i < 10; i++){
p = MwTreeViewAdd(tv, p, NULL, "Hello");
void* old = p;
MwTreeViewAdd(tv, old, px, "World");
p = MwTreeViewAdd(tv, old, px, "Hello");
if(i == 5) r = p;
MwTreeViewAdd(tv, old, px, "Goodbye");
}
MwLoop(wmain);