flexx icon indicating copy to clipboard operation
flexx copied to clipboard

Added a DynamicWidgetContainer

Open ceprio opened this issue 3 years ago • 1 comments

Hi Almarklein,

I've added a dynamic container for widgets. I'm using it for a few applications and I thought of sharing it as I see some questions regarding adding and removing widgets on the fly.

Look at the examples, it will show you what it is capable of.

Side note: The file flexx/event/_js.py was not working for me, there is some error in _clean_code_of_thread_stuff. It seem to block a lot of examples so you are probably on it. Just use the old version or the fixed one if you have one.

Have fun ;)

ceprio avatar Jan 13 '22 03:01 ceprio

If I understand correctly, this new class is needed, because although the JS Widget supports dynamically changing parents, this does not really work for the PyWidget, right?

Yes, that is right. My goal is to have a flexx server that can dynamically serve a client application. The GUI of the client can change completely according to the user actions: view it as a web page that a user is browsing where the pages are dynamically generated by the flexx application.

I'm currently working with that class and will try to put a better sample at one point. Especially the sample with the thread which is intended for a single client application and that should be extended to serve multiple browser clients.

I will work on the requested changes (Though not right away for some of them; let me play more with the base class and come back with better samples).

ceprio avatar Jan 26 '22 13:01 ceprio