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

Add a new method for Box to clear the children. #352

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

p1gd0g
Copy link

@p1gd0g p1gd0g commented Mar 28, 2019

It seems there is no way to get the size of a Box, thus it is hard to clear children out of the definition.

Then I add the new method using Delete, please check if it is worth.

Thank you.

@andlabs
Copy link
Owner

andlabs commented Mar 28, 2019

What are you trying to accomplish with this? Keep in mind that when you delete something from the Box, the child control sticks around.

@p1gd0g
Copy link
Author

p1gd0g commented Mar 28, 2019

@andlabs Thank you for the reply.

Yes, the child sticks so I want to clear all and then reconstruct the Box.

What I am trying to accomplish is a "table", however you know there is a bug on GTK+

// - the table on GTK+ is very thin; the scrolled window needs hexpand=TRUE

I have tried other Control, grid, form, which works not well. Thus I create the new method to quickly reconstruct a "table" using Box.

Please imform me if you have some advise.

Thank you. 😊

@treystout
Copy link

Came here to request the same feature. Loading dynamic lists from HTTP/JSON and using a VerticalBox for each item. Options I see right now when loading new data (AFAIK)...

  • Currently: keep an independent store of what items are in the box, and use it's length to just call box.Delete(n) over and over
  • Nice to have: expose the length of children in a Box (solves issue of independent store being out of sync with the GUI)
  • Best: The Clear() proposed here

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

Successfully merging this pull request may close these issues.

3 participants