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

Using enaml just to invoke kiwisolver #468

Closed
maxme1 opened this issue Jan 4, 2022 · 7 comments
Closed

Using enaml just to invoke kiwisolver #468

maxme1 opened this issue Jan 4, 2022 · 7 comments

Comments

@maxme1
Copy link

maxme1 commented Jan 4, 2022

Hi!

Is it possible to create a nested widgets structure (e.g. some Labels in a Container) in Python without *.enaml files and generate the coordinates and sizes for each widget?

Basically, I am trying to render a static gui (without user interaction or resizing), and I would like to use kiwisolver to correctly position the widgets.

@sccolbert
Copy link
Member

sccolbert commented Jan 4, 2022 via email

@sccolbert
Copy link
Member

sccolbert commented Jan 4, 2022 via email

@tstordyallison
Copy link

Or do you still actually want to use enaml just without the files (that is possible too)?

@maxme1
Copy link
Author

maxme1 commented Jan 4, 2022

I found out here that each Container already has a solver which is recursively invoked to solve the constraints for the tree.
However, I couldn't find the solver in the class definition, nor how to provide my own solver a solve the constraints.

Also, I couldn't figure out how to create a Container which has some children.
Neither Container(children=[...]) nor

c = Container()
c.insert_children(None, [...])

seem to work.

I could implement my own widgets tree from scratch just by using kiwisolver, but enaml feels like a very promising framework for that.

@sccolbert
Copy link
Member

sccolbert commented Jan 4, 2022 via email

@maxme1
Copy link
Author

maxme1 commented Jan 4, 2022

I read all the docs from here, the relevant parts from here as well as parts of enaml's source code regarding the Container and Constrainable.

I am sorry if my question is too basic, but some pointers or examples would be very helpful.

@maxme1
Copy link
Author

maxme1 commented Jan 9, 2022

I ended up generating python bindings for yoga.
Thanks for your time though.

@maxme1 maxme1 closed this as completed Jan 9, 2022
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

No branches or pull requests

3 participants