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

MenuWidget implementation #315

Open
JohnLunzer opened this issue Dec 9, 2016 · 11 comments
Open

MenuWidget implementation #315

JohnLunzer opened this issue Dec 9, 2016 · 11 comments

Comments

@JohnLunzer
Copy link

The background for this enhancement request is that there is interest from a not-well-known but venerable python IDE (for which I am a minor contributor) to implement a browser-based GUI. Currently it uses PyQt as its GUI framework. Flexx is an exciting prospect for Leo as it represents an opportunity to bring Leo to a new audience.

I think the two biggest barriers right now are a lack of MenuWidget and a lack of a code editor widget.

Phosphor has a built-in Menu class. Additionally Phosphor provides an example of a CodeMirror based code editor widget being used with the Menu widget.

I thought I read somewhere that Pyzo plans an eventual move over to Flexx. Am I imagining that?

@almarklein, the fact that this can even be considered and discussed is a testament to the amazing work you've done on Flexx.

@Korijn
Copy link

Korijn commented Dec 9, 2016

Personally, I've found the Label widget to be a nice and simple starting point for writing your own widgets that wrap around something else. Can't wait to see what Almar thinks of this cool suggestion!

@almarklein
Copy link
Member

Thanks @JohnLunzer.

Flexx should definitely have a MenuWidget. Since Phosphor already has it, I don't expect it to be that much work, I've simple never needed it yet.

I also like the idea of an editor widget, and even have a branch with a start of one based on canvas. CodeMirror is also used in JupyterLab. I have not looked at it that much yet, but my impression is that its too limited for a serious IDE. Writing one from scratch is a pretty big task though! Thinking out loud here, maybe a better editor component for JLab should be written in Flexx ...

I thought I read somewhere that Pyzo plans an eventual move over to Flexx. Am I imagining that?

Kind of. Two years ago I was planning on rewriting Pyzo, and call it Zoof (ideas are on this outdated website). Travis Oliphant suggested it would be awesome if that could run in a browser, and that's how Flexx was born. At that time Pyzo was still called IEP and Pyzo was a distro; Zoof would be a combination of sorts. Because building Flexx was not done in 6 months :P, I started bringing some ideas of Zoof to the existing tools, the most prominent being merging the two and calling it Pyzo (its confusing, I know).

For the past few months I've been working with Continuum to make Flexx work on JLab so people can extend JLab by writing Python. I plan to try to implement the ideas that I had for Zoof in JLab and see if I can turn it into what I envisioned with Zoof.

Leo is cool; it offers a very interesting concept. I've tried it a few times, but could not get used to it ... though maybe I did not try it long enough.

@JohnLunzer
Copy link
Author

@almarklein I agree that writing a code editor element is serious work. Going on CodeMirror's site and looking at the features/demos it looks to be suitable as an easy to implement placeholder, at the very least, until a more robust solution can be determined. It would be nice that have something in place for people (like myself) to start playing with and trying to build a GUI around. Better to have something (imperfect) than nothing.

Thanks for your thoughts on Zoof (Pyzo). It's exciting to think about the future of Python-based IDEs.

Leo is hard to get used to. As an IDE it's missing many features (which, in it's defense, I should be adding as plugins) but now I can't live without the inherent structure that Leo injects into my coding, I often get lost without it.

@almarklein
Copy link
Member

I suspect it wont be that hard to make a widget that wraps a codemirror element.

@almarklein
Copy link
Member

I suspect it wont be that hard to make a widget that wraps a codemirror element.

No, not that hard: #323

@JohnLunzer
Copy link
Author

Additionally, an important component of desktop applications that is part of Phosphor but not implemented in Flexx is the Menu item which allows desktop style right click context menus. The phosphor Menu object appears to be a prerequisite for creating MenuBar items so probably Menu will come in anyway, but I wanted to be as explicit as possible.

I almost feel like this issue should be renamed to something "UI elements supporting desktop style applications".

I still have a high interest in using Flexx for desktop style applications, I'm looking forward to the menu widgets.

@almarklein
Copy link
Member

Yes, I believe the Phosphor code for Menu is there, it just needs to be wrapped. Time is a scarce resource though ;) I will remove the reference to the editor, to let this issue represent the Menu feature.

@almarklein almarklein changed the title MenuWidget and CodeEditorWidget MenuWidget implementation Mar 2, 2017
@JohnLunzer
Copy link
Author

It's been a year and I just wanted to check in.

I know it might seem silly but the lack of the MenuWidget is one of the primary reasons I do not consider Flexx more often for my desktop apps. Well... one of the hallmarks of the desktop app is menu bar.

@almarklein
Copy link
Member

@JohnLunzer Thanks for the heads-up! This has not been a priority so far. Now that we're nearing a release, its not unlikely that I/we will be building more stuff with Flexx, and might run into the need ourselves... but don't expect it next week :)

@JohnLunzer
Copy link
Author

JohnLunzer commented Mar 30, 2018 via email

@almarklein almarklein modified the milestones: v0.6, v1.0 Oct 2, 2018
@huangxin168
Copy link

Haha, nothing that urgent. My intention was a gentle reminder ;)

context menu is the major issue that I think about wether to use flex...

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

No branches or pull requests

4 participants