On Tue, 5 Jun 2012 06:27:57 -0700 (PDT)
"Edward K. Ream" <[email protected]> wrote:
> I don't understand how c.give_me_an_editor_widget helps. My best
> guess is that it will integrate with the code in::
>
> leoPy.leo#@file ../plugins/qtGui.py-->Frame and component
> classes...-->
> class leoQtBody (subclass of leoBody)-->Editors (qtBody)
>
> Here is where I am coming from. There is a lot of *complex* code in
> the tree I've just written that handles switching focus between
> editors. Terry, are you planning to use that code, or rewrite it?
I don't think there should be any need to rehash any of that complexity.
I don't doubt that the code is complex, but the behavior seems
relatively simple:
+ the tree position changes
- body editors should change their content to that of the newly
selected node, *unless the body editor's editor-follows-tree flag
is False*
+ a body editor loses focus
- not sure if anything in particular needs to happen here
+ a body editor gains focus
- the tree should update to the position of the body editor's node,
*unless the body editor's tree-follows-editor flag is False*
[note that's two different flags, tree-follows-editor and
editor-follows-tree]
There need to be mechanisms for toggling these two flags, but that's
trivial, Alt-x commands would do to start, maybe context menu entries
later.
What I hope to have / perhaps already exists is a method, presumably
method of c, which supplies w, the body editor widget. That's the
c.give_me_an_editor_widget(p=None) I'm talking about.
Maybe it already exists, or maybe the current system works something
like this:
- place widget in a particular place in Leo's GUI
- do a bunch of initialization stuff on it
if that's the case, I think that could be refactored hopefully with
little work to:
- create widget
- do a bunch of initialization stuff on it
- return it to caller
where the caller may be the current system which sticks it in a
particular place in Leo's GUI, or free_layout which inserts it into the
free_layout.
There are a lot of minor details like deciding whether body editors
should have titles etc. - not sure if they existing multiple editor
titles would work for that or a simple wrapper widget in free_layout,
but those a minor, if there's a source of well behaved body editor
widgets that don't care about where in the GUI they are or how many of
them there are or anything else that isn't their business, it should be
easy to insert them into the free_layout framework.
I'll try and find time to look at the code you point to, to see if this
method already exists.
Cheers -Terry
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.