On Mon, 8 Aug 2011 15:26:30 -0500 Kent Tenney <[email protected]> wrote:
> On Mon, Aug 8, 2011 at 2:35 PM, Terry Brown <[email protected]> wrote: > > On Mon, 8 Aug 2011 13:05:16 -0500 > > Kent Tenney <[email protected]> wrote: > > > >> Is it possible to do this from a button or setting ... > >> (more light-weight + localized than a plugin) ? > >> > >> I would check p.isDirty() on losing focus and > >> populate a list of recent node edits. > >> > >> Use it to generate a @bookmark tree for the last 10 > >> nodes I've edited ... > > > > A button can do the same things a plugin would do... > > So the code below doesn't have requirements as to when it's called? > > A handler can be added at any time? Yep, I don't think there's any restriction. Cheers -Terry > > def make_handler(c): > > """closure to provide breadcrumb handler for c""" > > def handler(tag, keywords, c=c): > > if 'c' not in keywords or keywords['c'] != c: > > return # wrong number > > c._breadcrumbs.append(c.p.UNL()) > > if len(c._breadcrumbs) > 10: > > c._breadcrumbs.pop(0) > > return handler > > > > if not hasattr(c._breadcrumbs): > > c._breadcrumbs = [] > > g.registerHandler('lost-focus', make_handler(c)) > > # it's not lost-focus, I don't know what it is off hand > > Looks like it'd be a "select" event > > Event name (tag argument) Stop? When called > Keys in keywords dict > > 'select1' yes before selecting a position > c,new_p,old_p,new_v,new_v > 'select2' after selecting a position > c,new_p,old_p,new_v,old_v > 'select3' after selecting a position > c,new_p,old_p,new_v,old_v > > or maybe the "unselect" events: > > 'unselect1' yes before unselecting a vnode > c,new_p,old_p,new_v,old_v > 'unselect2' after unselecting a vnode > c,new_p,old_p,old_v,old_v > > It'll take some playing to figure out how each of the above works. > > Thanks, > Kent > > > > > -- > > 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. > > > > > -- 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.
