emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

insert nodes into tree-widget


From: Nic Ferrier
Subject: insert nodes into tree-widget
Date: 04 Jul 2004 16:14:40 +0100

I've got _most_ of a non-blocking IMAP client going. 

There's a nice nbio IMAP library underneath doing most of the
work. It's quite a good illustration of how to do nbio in Emacs.

The only trouble is the user interface. I've written an IMAP client
in Emacs before and used text in buffers. But this time I thought I'd
use tree-widget.

The trouble is I need to add nodes to tree-widget
asynchronously. What I'd really like to do is use dynamic node
creation but keep a reference to the widget supplied and insert nodes
into it later, eg:

(widget-create 'tree-node :tag "inbox" :dynargs 'tree-branch)

(defun tree-branch (widget)
  (lexical-let ((branch (widget-get widget :tag)))
    (async-get-msgs 
            for-tree
            (lambda (messages)
              (mapc (lambda (msg)
                       (widget-insert-node branch
                          `(item :tag ,msg))) messages)))
   ;; Return none for now... they'll be inserted by the callback
   nil))

I may be missing something about tree-widget (or widgets in general)
but I don't think you can dynamically change them like this...

It would be useful to do. Does anyone have any thoughts about the
feasability of doing this?

 
-- 
Nic Ferrier
http://www.tapsellferrier.co.uk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]