Any Tkinker based rich text widget?

S

sullivanz.pku

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!
 
S

Sullivan WxPyQtKinter

In addiiton, I hope it directly support basic HTML grammar.

(e-mail address removed) 写é“:
 
F

Fredrik Lundh

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>
 
S

Sullivan WxPyQtKinter

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===============
 
S

Sullivan WxPyQtKinter

Thank you so much for help. It is my honor to get a reply from a
prestigious figure like you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top