unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* insert nodes into tree-widget
@ 2004-07-04 15:14 Nic Ferrier
  0 siblings, 0 replies; only message in thread
From: Nic Ferrier @ 2004-07-04 15:14 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-07-04 15:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-04 15:14 insert nodes into tree-widget Nic Ferrier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).