Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding to a TreeWidget doesn't work in certain contexts #278

Closed
TheGag96 opened this issue Jul 18, 2016 · 3 comments
Closed

Adding to a TreeWidget doesn't work in certain contexts #278

TheGag96 opened this issue Jul 18, 2016 · 3 comments
Assignees
Labels

Comments

@TheGag96
Copy link
Contributor

I'm trying to incorporate a TreeWidget in my app, and I'm running into a problem where newChild() doesn't work if I use it in a button's click delegate. My code is more or less like this:

//note: i registered TreeWidget in DML manually
aTree= mainWindow.mainWidget.childById!TreeWidget("aTree");
aButton= mainWindow.mainWidget.childById!Button("aButton");

//this stuff works
TreeItem tree1 = aTree.items.newChild("group1", "Group 1"d, "document-open");
aTree.items.newChild("group2", "Group 1"d, "document-open");
tree1.newChild("g1_1", "Group 1 item"d);

aButton.click = delegate(Widget w) {
  //doesn't work, but is for sure being ran
  aTree.items.newChild("someid", "Some text"d);

  return true;
};

I assume this is a bug, but of course it could just be me doing something wrong. Thanks again!

@buggins buggins self-assigned this Jul 21, 2016
@buggins buggins added the bug label Sep 8, 2017
@buggins
Copy link
Owner

buggins commented Sep 11, 2017

Fixed - see example1.
TreeWidget now has add item / remove item buttons to test dynamic tree updates.

@TheGag96
Copy link
Contributor Author

Oh awesome!! Nice to see this one finally fixed. Thank you!

@buggins
Copy link
Owner

buggins commented Sep 15, 2017

thanks for reporting this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants