Re: How to launch Leo via pythonw.exe with an Anaconda environment but without an extra console window?

2018-11-08 Thread Matt Wilkie

>
> Scheduler or auto-run don't fit how what I'd like, I just want a shortcut 
> to launch Leo :)
> The pip-packaged version might be an option, but I'm running Leo from Git 
> and also prefer to have Anaconda for installing packages.
>
 
I run Leo from Git also. You can use conda to install all the other 
packages and pip just for Leo, and use the --editable flag `pip install 
--editable .\path\to\clone\leo-editor`

-- 
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-08 Thread Edward K. Ream
On Thu, Nov 8, 2018 at 11:42 AM rengel  wrote:

Thank you for all the detailed answers!
> I might have found the answer in one of the examples (in case you're
> interested:
>
> https://flexx.readthedocs.io/en/stable/examples/hv_layout_src.html#hv-layout-py
> )
> It contains several widgets with different sizes set. I'll try them out
> tomorrow and will keep you posted.
>

Thanks.  It's good to see people getting excited about this.

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.


Added pscript.leo study outline to leo-editor-contrib/master

2018-11-08 Thread Edward K. Ream
https://github.com/leo-editor/leo-editor-contrib/blob/master/StudyOutlines/pscript.leo

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-08 Thread rengel
Both the CSS and the inline style honor the color settings, but not the 
with and height settings.

>
> My guess is that the VBox() and HBox() layouts override the width and 
> height settings.
>
> Thank you for all the detailed answers!
I might have found the answer in one of the examples (in case you're 
interested:
https://flexx.readthedocs.io/en/stable/examples/hv_layout_src.html#hv-layout-py)
It contains several widgets with different sizes set. I'll try them out 
tomorrow and will keep you posted.

Reinhard

-- 
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-08 Thread Terry Brown
On Thu, 8 Nov 2018 08:47:39 -0800 (PST)
"Edward K. Ream"  wrote:

> On Thursday, November 8, 2018 at 7:04:05 AM UTC-6, Edward K. Ream
> wrote:
> 
> *How to communicate between components?*

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

Cheers -Terry

> [big snip]
> 
> Happily, flexx properties provide everything needed.  Apparently, 
> > properties must be used to communicate even between different
> > flx.Widgets. That is, the ivars of one widget are not accessible to
> > other flx.Widgets. So the example code above might better be
> > rewritten this way:
> >
> > class LeoMainWindow(flx.Widget):
> > 
> > """
> > Leo's main window, that is, root.main_window.
> > 
> > Each property x below is accessible as root.main_window.x.
> > """
> > 
> > body = flx.AnyProp(settable=True)
> > log = flx.AnyProp(settable=True)
> > minibuffer = flx.AnyProp(settable=True)
> > status_line = flx.AnyProp(settable=True)
> > tree = flx.AnyProp(settable=True)
> >
> > def init(self, body, outline):
> > with flx.VBox():
> > with flx.HBox(flex=1):
> > tree = LeoTree(outline, flex=1)
> > log = LeoLog(flex=1)
> > body = LeoBody(body, flex=1)
> > minibuffer = LeoMiniBuffer()
> > status_line = LeoStatusLine()
> > self._mutate_body(body)
> > self._mutate_log(log)
> > self._mutate_minibuffer(minibuffer)
> > self._mutate_status_line(status_line)
> > self._mutate_tree(tree)
> >
> 
> I buried the lede big time here.  I wanted to emphasize that *all* 
> flx.Widgets have a root ivar 
> ,
>  
> which is the LeoApp instance.  So it's easy to add to the log
> widget!  For example, here is the event handler in the LeoTree class:
> 
> @flx.reaction(
> 'tree.children**.checked',
> 'tree.children**.selected',
> 'tree.children**.collapsed',
> )
> def on_event(self, *events):
> 
> log = self.root.main_window.log
> for ev in events:
> id_ = ev.source.title or ev.source.text
> kind = '' if ev.new_value else 'un-'
> s = kind + ev.type
> log.put('%s: %s' % (lpad(s, 15), id_))
> 
> Recall that pscript does not support features such as "10%s" which is
> why the code above does padding by hand using the global lpad
> function. Finally, here is log.put:
> 
> def put(self, s):
> self.ace.setValue(self.ace.getValue() + '\n' + s)
> 
> 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-08 Thread Edward K. Ream
On Thursday, November 8, 2018 at 7:04:05 AM UTC-6, Edward K. Ream wrote:

I forgot to mention that instantiating a flx.Widget or flx.PyComponent does 
*not* cause the init methods to be called immediately.  That happens (much) 
later.  In particular,  calls to self._mutate_whatever will set properties 
at some (much) later time.

This does not cause difficulties, provided that one doesn't expect instant 
action.

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-08 Thread Edward K. Ream
On Thursday, November 8, 2018 at 7:04:05 AM UTC-6, Edward K. Ream wrote:

*How to communicate between components?*
>

[big snip]

Happily, flexx properties provide everything needed.  Apparently, 
> properties must be used to communicate even between different flx.Widgets.  
> That is, the ivars of one widget are not accessible to other flx.Widgets.  
> So the example code above might better be rewritten this way:
>
> class LeoMainWindow(flx.Widget):
> 
> """
> Leo's main window, that is, root.main_window.
> 
> Each property x below is accessible as root.main_window.x.
> """
> 
> body = flx.AnyProp(settable=True)
> log = flx.AnyProp(settable=True)
> minibuffer = flx.AnyProp(settable=True)
> status_line = flx.AnyProp(settable=True)
> tree = flx.AnyProp(settable=True)
>
> def init(self, body, outline):
> with flx.VBox():
> with flx.HBox(flex=1):
> tree = LeoTree(outline, flex=1)
> log = LeoLog(flex=1)
> body = LeoBody(body, flex=1)
> minibuffer = LeoMiniBuffer()
> status_line = LeoStatusLine()
> self._mutate_body(body)
> self._mutate_log(log)
> self._mutate_minibuffer(minibuffer)
> self._mutate_status_line(status_line)
> self._mutate_tree(tree)
>

I buried the lede big time here.  I wanted to emphasize that *all* 
flx.Widgets have a root ivar 
,
 
which is the LeoApp instance.  So it's easy to add to the log widget!  For 
example, here is the event handler in the LeoTree class:

@flx.reaction(
'tree.children**.checked',
'tree.children**.selected',
'tree.children**.collapsed',
)
def on_event(self, *events):

log = self.root.main_window.log
for ev in events:
id_ = ev.source.title or ev.source.text
kind = '' if ev.new_value else 'un-'
s = kind + ev.type
log.put('%s: %s' % (lpad(s, 15), id_))

Recall that pscript does not support features such as "10%s" which is why 
the code above does padding by hand using the global lpad function. 
Finally, here is log.put:

def put(self, s):
self.ace.setValue(self.ace.getValue() + '\n' + s)

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-08 Thread Edward K. Ream
On Thursday, November 8, 2018 at 8:35:30 AM UTC-6, rengel wrote:

did you set some window parameters using a CSS stylesheet?
>

I just talked to my brother Speed, and he said that leoflexx.py is causing 
files to be downloaded.  Indeed it is. I'm not sure this is related to your 
question, but here goes.

In the LeoBody node, just before the definition of class LeoBody, the 
following appears:

base_url = 'https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.6/'
flx.assets.associate_asset(__name__, base_url + 'ace.js')
flx.assets.associate_asset(__name__, base_url + 'mode-python.js')
flx.assets.associate_asset(__name__, base_url + 'theme-solarized_dark.js')

This might be a concern for some people.

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-08 Thread Edward K. Ream
On Thursday, November 8, 2018 at 8:35:30 AM UTC-6, rengel wrote:

Thanks for sharing!
>

You're welcome.

How did you run LeoMainWindow, in the browser - app.launch('browser') - or 
> as a desktop app - app.launch('app')? 
>

>From a console I ran a .bat file containing just:

python leo\plugins\leoflexx.py --flexx-webruntime=
browser

The top-level of leoflexx.py is now just:

import leo.core.leoBridge as leoBridge
from flexx import flx
@others
if __name__ == '__main__':
flx.launch(LeoApp, runtime='firefox-browser')
print('After flx.launch')
flx.run()

On my machine this opens mozilla.

did you set some window parameters using a CSS stylesheet? 
>

All the .css is in leoflexx.py.  In particular, the body page uses ace, 
whose startup code contains:

self.ace.setTheme("ace/theme/solarized_dark")

I couldn't figure out how to set the parameters of the main window.
>
[snip]

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

My guess is that the VBox() and HBox() layouts override the width and 
height settings.

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-08 Thread rengel
Thanks for sharing!
How did you run LeoMainWindow, in the browser - app.launch('browser') - or 
as a desktop app - app.launch('app')? If you tried the second variant, did 
you set some window parameters using a CSS stylesheet? If so, how? Right 
now, I couldn't figure out how to set the parameters of the main window. I 
tried:

from flexx import flx

class MainWindow(flx.Widget):

 CSS = """
 .flx-VBox {width: 1200px; height: 800px; background: red;}
 """

 def init(self):

 with flx.VBox():
 self.workspace = flx.Widget(style='width: 1200px; height: 800px; 
background:#cc;', flex=1)


app = flx.App(MainWindow)
app.export('main.html', link=0) # Export to a single file
# app.launch('browser') # show it now in a browser
app.launch('app') # show it as a desktop app
flx.run() # enter the main loop

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

-- 
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: Not Leo in Flexx

2018-11-08 Thread Edward K. Ream
On Tue, Nov 6, 2018 at 9:29 AM Terry Brown wrote:

For a while (since Aug. 9 2018 according to git) I've been fiddling
> with a Flexx based app. that is Leo like.  But not Leo.  It's an
> experiment with a different data model (VDCG, Vaguely Directed Cyclic
> Graphs).


Hehe.  Good name.

The initial question is can you navigate this using a tree?

...

> App. components aren't directly connected, they broadcast messages that
> other components can react to, or not.

...
Iirc, Ville suggested the sea of nodes. Imo these ideas are definitely
worth exploring.

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.