Re: current commander
well found out I can solve it by using c as an argument in the functions defined in the other Leo window. Then I can call those functions from other leo windows using their 'c' as argument. -- 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 http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: Installing Leo Mint
It's tragic if Leo ends up keeping someone stuck in Windows :-} Tragic?!? Rather, you should feel honored ;) BTW, I was not actually planning to abandon Windows altogether, so I guess it is not a major inconvenience, after all. -- 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 http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: current commander
On Thu, 26 Jun 2014 02:41:01 -0700 (PDT) Fidel N fidelpe...@gmail.com wrote: well found out I can solve it by using c as an argument in the functions defined in the other Leo window. Then I can call those functions from other leo windows using their 'c' as argument. Ok, good, I don't remember exactly where I ended up with that. Just poking around now, I believe, for the tabbed interface, g.app.gui.frameFactory.masterFrame.currentWidget().leo_c is the currently visible c. But it would be nice to have g.current_commander() which worked with both the tabbed and un-tabbed interfaces. Although maybe the concept makes no sense for un-tabbed and detached tab interfaces, just a question of window manager focus. Cheers -Terry -- 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 http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: current commander
Wow, your solution is FAR better than what I was going to do. You saved me a few headaches again, thanks Terry! -- 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 http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: Installing Leo Mint
On Wed, Jun 25, 2014 at 1:26 PM, duf...@gmail.com wrote: I have just installed the latest Linux Mint (v17, Mate), and it's the first Linux installation that I am actually planning to use, after having tried and tested many other distros. This has been an interesting discussion. Thanks for all the comments. Both Linux and Windows have their respective strengths and weaknesses. Imo, it's natural to use both. The key point, from my point of view, is that it is possible to use the same (console-oriented) work flow on both platforms. I encourage you to play with Leo on Linux. Once you have Leo installed properly, updating Leo with git should be a snap on either platform. 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 http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: Calling a leo class function from the minibuffer
On Wed, Jun 25, 2014 at 2:48 PM, 'Terry Brown' via leo-editor leo-editor@googlegroups.com wrote: On Wed, 25 Jun 2014 12:17:40 -0700 (PDT) Fidel N fidelpe...@gmail.com wrote: And the main thing is its the other way around. AHK sniffs around my actions, then points to Leo commands to complete them. So if I want to add my selected text (outside Leo) as a child of currently Leo selected node, AHK helps me call a command in Leo. Hmm, I'd probably use a Leo button, Yes, that's natural. As Fidel probably knows, @button and @command nodes create commands that can be executed from the minibuffer (and bound to keys) But I'd like to step back a bit and make a more general point, one that relates to Offray's post re the discussion of Leo and Light Table. (I'll say more on that thread later today.) The point is this: Leo allows any node to contain a (simple!) python script, so even though a user doesn't think of themselves as a programmer, any conceivable set of mundane actions can be automated. This includes creating @button nodes, or other commands, or data or whatever. Without knowing in detail exactly what you want to do, the general approach of writing one or more helper scripts is right on target. HTH. 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 http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: Calling a leo class function from the minibuffer
Yes, I am currently very happy with my solution. I made this Leo command, which I put in myleosettings.leo file: from Tkinter import Tk r = Tk() script = r.clipboard_get() exec(script) c.gui.replaceClipboardWith(result) Then I made an AHK function that calls that command, and since Leo runs the code inside the clipboard, this works as a link between AHK and Leo. Also, it returns a value that AHK picks up. All through the clipboard, and then the clipboard is restored to the original value before that. The good thing is that I am running python (leo) scripts directly from AHK, with python syntax. AHK is a very good automation language but lacks of string transformation syntax, so I can be doing something in any program whatsoever, click a button, and ahk sends my text for Leo to process it and give me back what I want, or do something, well. Also, the class I am using is hanging under a @script node, and its in g.f.etc So whenever I update that class, I just run the @script node again, and I dont have to restart Leo to use a refreshed class with new commands. Very quick and cool. This is the AHK function that runs code in Leo, just in case anyone is interested: ;RunLeoCommand with clipboard as argument rlc_clipboard(var){ tmp = %ClipboardAll% ; save clipboard% Stringreplace, var, var, (), (arg0) quotes = ''' full_command = arg0 `= %quotes%%Clipboard%%quotes% `nresult `= %var% Clipboard = %full_command% LeoWasActive = 0 SetTitleMatchMode, 2 WinGet, id, ID, `.leo in ,, Program Manager IfWinActive, ahk_id %id% { LeoWasActive = 1 } WinActivate, ahk_id %id% Sleep, 200 Send, {Alt Down}{x}{Alt Up}ahk-run-clipboard-script{Enter} Sleep, 200 ;Wait until clipboard has changed into the desired result: ; if LeoWasActive = 0 ; { ; Send !{Esc} ; } ClipWait, 1 returned_value = %Clipboard% Clipboard = %tmp% ; restore old content of the clipboard return, %returned_value% } If anyone wants more details, just ask! -- 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 http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: Calling a leo class function from the minibuffer
Hi Fidel I don't intend to disparage AutoHotKey, which I used a little many moons ago and remains a well-thought of program. But you might be interested in some python-based alternatives for Windows automation. The ones I know of are: pywinauto:https://code.google.com/p/pywinauto/ autopy: https://pypi.python.org/pypi/autopy/0.51 swapy: https://code.google.com/p/swapy/ I have played only a little with one of these (pywinauto) but it strikes me that you might get the best of both worlds here... HTH jon N -- 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 http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: Support for Qt5 has begun
On Sun, 15 Jun 2014 11:53:07 -0500 'Terry Brown' via leo-editor leo-editor@googlegroups.com wrote: Another instance of this trap: https://github.com/leo-editor/leo-editor/commit/ecca25af I think searching for all occurrences of clicked() and triggered() with both kinds of quotes would find these. In the above fix I didn't follow my own advice, make the callbacks match the basic definition of the signals, hmmm. Cheers -Terry Here's a trap though: -def setter(pri=pri): o.setPri(pri) -self.connect(w, QtCore.SIGNAL(clicked()), setter) +def setter(pri=pri): +o.setPri(pri) +if isQt5: +w.clicked.connect(setter) +else: +self.connect(w, QtCore.SIGNAL(clicked()), setter) The old form calls setter() with no parameters, the new form calls setter with `bool is_checked`, seeing buttons can be checked or unchecked when they're clicked. I think the best solution is to change setter() to be def setter(checked, pri=pri): ... which will work in both Qt4 and Qt5, basically the old style .connect() let you select whether that parameter got passed or not, but I think everything's cleaner if we just make the callbacks match the basic definition of the signals. -- 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 http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: Is there a way to move button toolbar to the continuation of the menubar?
On Fri, 20 Jun 2014 11:39:17 -0500 'Terry Brown' via leo-editor leo-editor@googlegroups.com wrote: I've just added the following commands: gui-all-hide gui-all-show gui-iconbar-hide gui-iconbar-show gui-menu-hide gui-menu-show gui-minibuffer-hide gui-minibuffer-show gui-statusbar-hide gui-statusbar-show and now gui-tabbar-hide gui-tabbar-show Cheers -Terry -- 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 http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: Inaccuracies with @shadow
On Mon, 23 Jun 2014 07:26:58 +1200 David McNab davidmcna...@gmail.com wrote: However, with numerous Python files, @shadow has been inaccurately writing out files. The main inaccuracies have been to do with indent levels for significant blocks of code (a massive dealbreaker in Python), which unless resolved makes Leo unusable in my team environment. Hmm, I'm editing a LaTeX doc. and using @shadow just to see how it goes, I could be using @file, but I've just noticed that @shadow was losing the nesting structure until I added `@others` at all the right places, which I don't think you need in @file, so not sure if that would help you or be too onerous. Cheers -Terry -- 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 http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: Is there a way to move button toolbar to the continuation of the menubar?
On Thu, 26 Jun 2014 13:54:32 -0500 'Terry Brown' via leo-editor leo-editor@googlegroups.com wrote: gui-minibuffer-show gui-statusbar-hide gui-statusbar-show and now gui-tabbar-hide gui-tabbar-show ...and, realizing that show and hide commands are bad candidates for key bindings, there are now toggle versions of each command. So the complete list is: gui-all-hide gui-all-show gui-all-toggle gui-iconbar-hide gui-iconbar-show gui-iconbar-toggle gui-menu-hide gui-menu-show gui-menu-toggle gui-minibuffer-hide gui-minibuffer-show gui-minibuffer-toggle gui-statusbar-hide gui-statusbar-show gui-statusbar-toggle gui-tabbar-hide gui-tabbar-show gui-tabbar-toggle Cheers -Terry -- 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 http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.