all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: help-gnu-emacs@gnu.org
Subject: Re: format text in TreeWidget.
Date: Mon, 10 Jan 2011 15:47:33 +0100	[thread overview]
Message-ID: <87tyhg24u2.fsf@member.fsf.org> (raw)
In-Reply-To: AANLkTik7YPAe=kSXTc9qLFq2M8Hf2VYaen9=vJ_fAcOB@mail.gmail.com

Alin Soare <as1789@gmail.com> writes:

> I did write the following code.
>
> As the :tag text is very long on some lines, and pass over the end the
> line, it is displayed on myltiple lines, and the tree looks spoiled. I
> wish to make the tree widget show the text formatted correctly, and on
> maximum N columns.

Hm, this somehow works, but is not perfect:

--8<---------------cut here---------------start------------->8---
(widget-create 'tree-widget
	       :node '(push-button :tag "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" :format "%[%t%]\n")
	       `(tree-widget
		 :tag ,(with-temp-buffer
			 (set-fill-column 50)
			 (insert "bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla")
			 (fill-paragraph)
			 (buffer-string)))
	       `(tree-widget
		 :tag ,(with-temp-buffer
			 (set-fill-column 60)
			 (insert "foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo")
			 (fill-paragraph)
			 (buffer-string)))
	       `(tree-widget
		 :tag ,(with-temp-buffer
			 (set-fill-column 70)
			 (insert "baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz")
			 (fill-paragraph)
			 (buffer-string))))
--8<---------------cut here---------------end--------------->8---

The problem is that only the first line has correct tree lines...

But maybe that's still a pointer into the right direction.

Bye,
Tassilo




  reply	other threads:[~2011-01-10 14:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-10  9:08 format text in TreeWidget Alin Soare
2011-01-10 14:47 ` Tassilo Horn [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-01-10 20:53 Alin Soare
2011-01-10 21:04 ` Alin Soare
2011-01-10 21:10 ` Chong Yidong

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

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

  git send-email \
    --in-reply-to=87tyhg24u2.fsf@member.fsf.org \
    --to=tassilo@member.fsf.org \
    --cc=help-gnu-emacs@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.