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

[BUG] invalid attr:variable? #44

Closed
mrx23dot opened this issue Oct 31, 2024 · 7 comments
Closed

[BUG] invalid attr:variable? #44

mrx23dot opened this issue Oct 31, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@mrx23dot
Copy link

mrx23dot commented Oct 31, 2024

A simple layout like this executes on green button:,
2024-10-31 13_23_26-Formation studio - C__apps_myApps_mSerial_testlayout xml

but when I add a checkbox, it doesn't show a preview when I press the green button.

if I remove
attr:variable=".!frame3.!panedwindow.!panedwindow.!tabview.!designcontext.!designer.!checkbutton2"

from xml line
<tkinter.ttk.Checkbutton name="checkbutton2" attr:variable=".!frame3.!panedwindow.!panedwindow.!tabview.!designcontext.!designer.!checkbutton2" attr:text="checkbutton2" layout:width="112" layout:height="25" layout:x="99" layout:y="88" layout:bordermode="outside"/>

it fixes the issue and shows the UI with
app = AppBuilder(path="testlayout.xml")

so looks like attr:variable is invalid (without any warning)

Your environment
OS: Windows
formation-studio-0.7.0
Python version: Python 3.7.0

@mrx23dot mrx23dot added the bug Something isn't working label Oct 31, 2024
@mrx23dot
Copy link
Author

mrx23dot commented Oct 31, 2024

interesting, attr:variable only created for checkbuttons, so might be related to #43

@mrx23dot
Copy link
Author

mrx23dot commented Oct 31, 2024

Regarding content of frame3.!panedwindow.!panedwindow why aren't any of these items in the xml?
Can I have a UI without main frame?

Also shouldn't there be an option for attr:variable in Attribute pane?

@ObaraEmmanuel
Copy link
Owner

Hello @mrx23dot. Thank you for you interest in Formation and raising this issue. The issues has been around for a while and I initially dismissed it as a simple annoyance but I will get round to fixing it.

interesting, attr:variable only created for checkbuttons, so might be related to #43

Yeah. They are definitely related and fixing one will resolve the other.

Regarding content of frame3.!panedwindow.!panedwindow why aren't any of these items in the xml?

Those are elements belonging to the studio's UI interface and not the design file. They are supposed to be stripped from the generated XML.

Also shouldn't there be an option for attr:variable in Attribute pane?

The option is there under variable.

@mrx23dot
Copy link
Author

mrx23dot commented Nov 1, 2024

Don't get me wrong, Formation is still the best editor I found for Tkinter, it's just a bit behind compared to wxPython editors. (but at least Tkinter is shipped with python)

Adding some warning msg to console would be great when there is something wrong in .xml layout (like invalid attr:variable), or assertion msg, currently it just exits without knowing why.

@ObaraEmmanuel
Copy link
Owner

Don't get me wrong, Formation is still the best editor I found for Tkinter, it's just a bit behind compared to wxPython editors. (but at least Tkinter is shipped with python)

Thanks for the commendations. The wxPython editors have been a round for longer and have a lot more people working on them. I am just one guy but I will do my best. I believe we can improve the state of the project when issues are reported like like this. So, feel free to report as many issues as you can find or suggest features.

Adding some warning msg to console would be great when there is something wrong in .xml layout (like invalid attr:variable), or assertion msg, currently it just exits without knowing why.

When previewing designs using the run button, they are run in a separate process so I will try to pipe the output back and display an error dialog.

@mrx23dot
Copy link
Author

mrx23dot commented Nov 1, 2024

Also when I run the same invalid .xml in my .py file
app = AppBuilder(path="testlayout.xml")

this line just exits, without reason, so you would need an assertion output that you could capture in the editor.

@ObaraEmmanuel
Copy link
Owner

This should be fixed. @mrx23dot you can add the error reporting on preview as a separate feature request issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants