Re: Wow: take a look at leoflexx.py

2018-11-09 Thread lewis
Leoflexx_js.py also needs updating. Suggest changing line 173:
from 
flx.launch(LeoMainWindow, runtime='firefox-browser')
to
flx.launch(LeoMainWindow)

Regards
Lewis


On Friday, November 9, 2018 at 11:55:07 PM UTC+11, Edward K. Ream wrote:
>
>
> Oops. leoflexx.py contained:
>
> flx.launch(LeoApp, runtime='firefox-browser')
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Wow: take a look at leoflexx.py

2018-11-09 Thread lewis
Running this works, launching chrome browser:
python N:\git\leo-editor\leo\plugins\leoflexx.py --flexx-webruntime=browser

Launching Chrome browser works:
python \leo\plugins\leoflexx.py 
--flexx-webruntime=chrome-browser

Launching Edge browser works:
python \leo\plugins\leoflexx.py 
--flexx-webruntime=edge-browser

But launching firefox browser:
python \leo\plugins\leoflexx.py 
--flexx-webruntime=firefox-browser
fails with message box
 [Webruntime - No suitable runtime available
  could not run app, because runtime firefox-browser is not available.]

Regards
Lewis

On Friday, November 9, 2018 at 11:55:07 PM UTC+11, Edward K. Ream wrote:
>
>
> Please let us all know how these work for you.
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


leo look on Mac OS 10.14 Mojave broken, and workaround

2018-11-09 Thread Marc-Antoine Parent
Good day, all!
Since some recent homebrew updates, Qt has been compiled for Mojave, and 
PyQt (or Qt) applications like Leo have become unusable. This is a known 
bug.
https://bugreports.qt.io/browse/QTBUG-68850

There will be a partial fix in Qt 5.12, but until this lands, I found that 
the following makes Leo usable again:

defaults write org.python.python NSRequiresAquaSystemAppearance -bool Yes

Regards,
Marc-Antoine

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Might be interesting for Leo WebApp

2018-11-09 Thread Edward K. Ream
On Friday, November 9, 2018 at 9:33:20 AM UTC-6, Edward K. Ream wrote:

Thanks for [the JS tree structures overview]  I've put this in my flexx 
> bookmarks folder.
>

This points to an important issue that will come into play later.  Many of 
us will be interested in interfacing with Joe Orr's work.  Presumably Joe 
has used JS tree components.

My guess, and it is only a guess, is that flexx can be made to work with 
any JS whatever.  In the worst case, via flexx's RawJS mechanism.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Might be interesting for Leo WebApp

2018-11-09 Thread Edward K. Ream
On Mon, Nov 5, 2018 at 8:18 AM rengel wrote:

JavaScript tree datastructures - an overview:
>
>
> https://stackoverflow.com/questions/8640823/what-javascript-tree-data-structures-are-available
>
Thanks for this.  I've put this in my flexx bookmarks folder.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Wow: take a look at leoflexx.py

2018-11-09 Thread Edward K. Ream
On Fri, Nov 9, 2018 at 6:08 AM lewis  wrote:

> I tried running leoflexx.py from a console:
> python N:\git\leo-editor\leo\plugins\leoflexx.py
> --flexx-webruntime=firefox-browser
> and get this Traceback:
>

Oops. leoflexx.py contained:

flx.launch(LeoApp, runtime='firefox-browser')

Rev 1cf84adca in skeleton removes this arg, so that command-line args have
a chance of taking effect.  Try it now, with whatever browser you like.

Not using --flexx-webruntime should bring up the demo in webruntime
.

Please let us all know how these work for you.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Wow: take a look at leoflexx.py

2018-11-09 Thread lewis
I tried running leoflexx.py from a console:
python N:\git\leo-editor\leo\plugins\leoflexx.py 
--flexx-webruntime=firefox-browser
and get this Traceback:

[I 22:51:01 flexx.app] Asset store collected 2 new modules.
[I 22:51:02 flexx.app] Serving apps at http://localhost:49190/
[I 22:51:02 flexx.app] Asset store collected 23 new modules.
Traceback (most recent call last):
  File "N:\git\leo-editor\leo\plugins\leoflexx.py", line 267, in 
flx.launch(LeoApp, runtime='firefox-browser')
  File 
"C:\Users\lewis\AppData\Local\Programs\Python\Python37\lib\site-packages\flexx\app\_funcs.py",
 
line 231, in launch
return a.launch(runtime, **runtime_kwargs)
  File 
"C:\Users\lewis\AppData\Local\Programs\Python\Python37\lib\site-packages\flexx\app\_app.py",
 
line 167, in launch
session._runtime = webruntime.launch(url, runtime=runtime, 
**runtime_kwargs)
  File 
"C:\Users\lewis\AppData\Local\Programs\Python\Python37\lib\site-packages\webruntime\__init__.py",
 
line 200, in launch
raise ValueError('Could not detect a suitable backend among %r.' % 
runtimes)
ValueError: Could not detect a suitable backend among ['firefox-browser'].
[end]

I have these modules installed:
 flexx to 0.7.0
 dialite-0.5.2
 pscript-0.6.3 
 webruntime-0.5.5

Leo Log Window
Leo 5.8.1 devel, build 20181103230124, Sat Nov 3 23:01:24 PDT 2018
Git repo info: branch = skeleton, commit = 53b46ed8259b
Python 3.7.1, PyQt version 5.11.2
Windows 10 AMD64 (build 10.0.17134) SP0
isPython3: True

I also tried the *webruntime=chrome-browser* option with same result.
Am I missing something?

Thanks
Lewis

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Learning flexx, part 2, and LeoWapp status

2018-11-09 Thread Edward K. Ream
On Friday, November 9, 2018 at 5:18:42 AM UTC-6, Almar Klein wrote:

BTW, you can use flx.ComponentProp() for components. 
>

Thanks.  I didn't know that ComponentProps existed.

A pattern which I like is to define actions on a "central" PyComponent (I 
> refer to this as the `store` in the docs, but it can be the root app) so 
> that you have a single"entry point" for JS calling out to Python. You can 
> do something similar for the JS side.
>

I'll play with this.  It's probably just what is needed.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Learning flexx, part 2, and LeoWapp status

2018-11-09 Thread Edward K. Ream
On Thursday, November 8, 2018 at 11:17:31 AM UTC-6, Terry Brown wrote:

I'd evaluate the emit / react ( / action) framework too - avoids having 
> to have everything know about everything else. 
>

Thanks for this.  Today's work will be about communicating between the 
Python code in LeoApp and the JS code in LeoTree, so that the JS code can 
update the body pane when switching nodes. I expect no major problems, but 
we shall see.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Learning flexx, part 2, and LeoWapp status

2018-11-09 Thread Almar Klein
Thanks for sharing this Edward! Thank you for your kind words about Flexx 
and PScript. And thanks for taking the time to write down your struggles. 
I'll try to boil it down to some points of action in Flexx/#516.


> Almar, please correct me if I am wrong about [using props like this].

Yes, you need to make properties for things that you want to make available 
from both Python and JS. Regular attributes work, but *only* withing Python 
or JS (depending on whether its a PyComponent or JsComponent).

BTW, you can use flx.ComponentProp() for components. A pattern which I like 
is to define actions on a "central" PyComponent (I refer to this as the 
`store` in the docs, but it can be the root app) so that you have a 
single"entry point" for JS calling out to Python. You can do something 
similar for the JS side. But I don't know if this works well for your 
use-case.


> Apparently, properties must be used to communicate even between different 
flx.Widgets. 

Or actions or events. Properties should be used to represent state. Actions 
are to "make stuff happen". Sometimes this can be a change in state. E.g by 
using the standard property setters. But actions don't have to mutate 
properties. Beware that actions are asynchronous; they don't apply the 
moment you call them (unless called from an action). This means that an 
action like x.delete_line() is better than taking all lines, deleting one, 
and setting the lines property again. Custom events are probably rare, but 
can be used for things that "happen" (e.g. some form of user input).


> Both the CSS and the inline style honor the color settings, but not the 
width and height settings.

This was answered already, but just to confirm: Flexx indeed overwrites 
these values. Any layout must be done using Flexx' layout classes. Also see 
e.g. the Widget.minsize and Widget.maxsize properties.


> leoflexx.py is causing files to be downloaded. 

You can also use local assets (put the ace.js etc. in the repo and include 
that). Someone recently made an howto for that: 
https://flexx.readthedocs.io/en/stable/examples/local_assets_src.html#local-assets-py


-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.