unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* format text in TreeWidget.
@ 2011-01-10  9:08 Alin Soare
  2011-01-10 14:47 ` Tassilo Horn
  0 siblings, 1 reply; 2+ messages in thread
From: Alin Soare @ 2011-01-10  9:08 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1395 bytes --]

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.




(widget-create (quote tree-widget) :node (quote (push-button :tag
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" :format "%[%t%]
"))
 (quote (tree-widget :tag
"...............................................................................................................................................................................................)
"))
 (quote (tree-widget :tag
"#################################################################################################################################################################################################################################"))
 (quote (tree-widget :tag
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$"))) <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>


How can I do this ?


Thanks for any help.

[-- Attachment #2: Type: text/html, Size: 1545 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: format text in TreeWidget.
  2011-01-10  9:08 format text in TreeWidget Alin Soare
@ 2011-01-10 14:47 ` Tassilo Horn
  0 siblings, 0 replies; 2+ messages in thread
From: Tassilo Horn @ 2011-01-10 14:47 UTC (permalink / raw)
  To: help-gnu-emacs

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-10 14:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-10  9:08 format text in TreeWidget Alin Soare
2011-01-10 14:47 ` Tassilo Horn

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).