469,352 Members | 1,782 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,352 developers. It's quick & easy.

Any Tkinker based rich text widget?

Hi all
I am using the standard python GUI Tkinter as my program's main
interface. Although I know wxPython has some widget to support rich
text widget, but I do not have time to shift to wx---- series. Does
anyone know any Tkinter based widget that support:

1. Blod, Italic, Underline and their combinations.
2. Several most commonly used fonts, like Times New Roman and Arial
3. Multiline text
4. Cross platform support. Available in Linux-RedHat and Mac OS series
and Windows 2000 or above.
5.Image embedding. Support jpeg, gif, bmp. The more the better.
and better support:
Hyperlink, Text color, the more the better.
Thank you so much for help!

Feb 19 '06 #1
4 10042
In addiiton, I hope it directly support basic HTML grammar.

su***********@gmail.com 写道:
Hi all
I am using the standard python GUI Tkinter as my program's main
interface. Although I know wxPython has some widget to support rich
text widget, but I do not have time to shift to wx---- series. Does
anyone know any Tkinter based widget that support:

1. Blod, Italic, Underline and their combinations.
2. Several most commonly used fonts, like Times New Roman and Arial
3. Multiline text
4. Cross platform support. Available in Linux-RedHat and Mac OS series
and Windows 2000 or above.
5.Image embedding. Support jpeg, gif, bmp. The more the better.
and better support:
Hyperlink, Text color, the more the better.


Thank you so much for help!


Feb 19 '06 #2
su***********@gmail.com wrote:
I am using the standard python GUI Tkinter as my program's main
interface. Although I know wxPython has some widget to support rich
text widget, but I do not have time to shift to wx---- series. Does
anyone know any Tkinter based widget that support:

1. Blod, Italic, Underline and their combinations.
2. Several most commonly used fonts, like Times New Roman and Arial
3. Multiline text
4. Cross platform support. Available in Linux-RedHat and Mac OS series
and Windows 2000 or above.
5.Image embedding. Support jpeg, gif, bmp. The more the better.

and better support:
Hyperlink, Text color, the more the better.


Tkinter's standard Text widget can do all this, of course:

http://effbot.org/tag/Tkinter.Text

by default, Tkinter only supports GIF and PPM, but you can use PIL's
ImageTk.PhotoImage class instead of Tkinter's own PhotoImage to get
support for ~30 more formats:

http://www.pythonware.com/products/pil/
http://effbot.org/tag/PIL.ImageTk

to deal with hyperlinks, use tag event bindings:

http://effbot.org/zone/tkinter-text-hyperlink.htm

:::

there's in fact a complete browser built on top of Tk's Text widget:

http://grail.sourceforge.net/

but I don't know how much work it would be to "widgetize" that
application.

hope this helps!

</F>

Feb 19 '06 #3
yes, I have tried Text Widget for quite some time. However, its speed
is far from satisfying.

When it holds more than 20,000 characters, it starts to response quite
slow. When you drag your mouse over some text to select, the selection
is usually done after 0.5second or so. My intent to use this widget is
to compose and process report as long as 30 to 60 pages.

Is it the problem of the Text widget or my usage? the following is the
code for testing Text widget. Run it and paste 20,000 characters, and
then it is retardant....

=======Code Start=========
from Tkinter import *
root=Tk()
root.title("Lab Report Editor")

text=Text(root,height=25)
text.grid(row=0,column=0,sticky=N+S+W+E)

root.columnconfigure(0,weight=1)
root.rowconfigure(0,weight=1)
root.mainloop()
===========Code End===============

Feb 21 '06 #4
Thank you so much for help. It is my honor to get a reply from a
prestigious figure like you.

Feb 21 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Jane Austine | last post: by
2 posts views Thread by Tonino | last post: by
5 posts views Thread by Justin Kennedy | last post: by
reply views Thread by sullivanz.pku | last post: by
10 posts views Thread by James Stroud | last post: by
5 posts views Thread by deacon.sweeney | last post: by
5 posts views Thread by MartinRinehart | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.