unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Nic Ferrier <nferrier@tapsellferrier.co.uk>
Subject: insert nodes into tree-widget
Date: 04 Jul 2004 16:14:40 +0100	[thread overview]
Message-ID: <87pt7biz33.fsf@tapsellferrier.co.uk> (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

                 reply	other threads:[~2004-07-04 15:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pt7biz33.fsf@tapsellferrier.co.uk \
    --to=nferrier@tapsellferrier.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).