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

Symmetry betwee PyWidget and Widget #698

Merged
merged 18 commits into from Jun 2, 2021
Merged

Conversation

ceprio
Copy link
Contributor

@ceprio ceprio commented May 26, 2021

Hi almarklein, I would like to push a change to have more symmetry between PyWidget and Widget:
I can do:

    with ui.Widget(style=overlay_style+"width:0%;") as self.waiting_overlay:
        (...)

But could not do:

    with ui.PyWidget(style=overlay_style+"width:0%;") as self.waiting_overlay:
        (...)

Which I found anoying as I'm using server side processing quite a lot and need to switch Widget from one side to the other seamlessly.

I changed the bokehdemo.py and inserted a PyWidget within to show the style in action.

I have a lot of other things relying on this change so I hope it goes forward one way or another. I hope to submit them at a later point when they get more reliable.

P.S. there is also an optimisation for flask serving within the code (in _flaskserver.py).

Thank you for your time.

flexx/ui/_widget.py Outdated Show resolved Hide resolved
@almarklein
Copy link
Member

Wow, thanks for this! You're brave to wander in the most complex parts of Flexx ;)

I took a good look and verified that (as far as I can see) popping these values have no consequences elsewhere. I have just a few comments. These are more nitpicky than I'd normally do, but since this code is complex it's worth being extra careful about comments.

@ceprio
Copy link
Contributor Author

ceprio commented Jun 2, 2021

Hi almarklein, the last commit integrates the requested changes on the comments.

Flexx is complex but that is what you get when trying to separate GUI from code. Is there a better way? I do think your solution is elegant and brings portability for the created widgets. That is the main driving force behind Flexx.

Thank you,

@almarklein
Copy link
Member

I meant that these low-level component classes are among the most complex code, but this solution is done very well :)

Anyway, thanks!

@almarklein almarklein merged commit cb10d56 into flexxui:master Jun 2, 2021
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.

None yet

2 participants