Re: pictures as characters in a Tk text box?



PERFECT!!! Thanks so much!


Simon Forman wrote:
Jay wrote:
This may be really obscure, but I had a dream about programming
something like this, so don't blame me. Is it possible to take a small
image or icon and display it as a character in a Tk text box? Think
how Thunderbird displays text smilies as actual smiley icons. Or how
in AIM as you type a smiley, it replaces it with the picture. Does
anyone know how to display these specifically in a Tk text box? Thanks.

Dreaming in Python, eh? Maybe you should take a break. ;-)

Sure, quoting the link below: "You can put an image or bitmap into a
text widget. It is treated as a single character whose size is the
natural size of the object."

You can also embed any Tk widget in a Tk Text widget, including
ImageTks and widgets with bitmaps.

See:
http://infohost.nmt.edu/tcc/help/pubs/tkinter/text-image.html
and
http://infohost.nmt.edu/tcc/help/pubs/tkinter/text-window.html


HTH,
~Simon

.



Relevant Pages

  • Re: pictures as characters in a Tk text box?
    ... Simon Forman wrote: ... image or icon and display it as a character in a Tk text box? ... "You can put an image or bitmap into a ... You can also embed any Tk widget in a Tk Text widget, ...
    (comp.lang.python)
  • Re: pictures as characters in a Tk text box?
    ... image or icon and display it as a character in a Tk text box? ... anyone know how to display these specifically in a Tk text box? ... It is treated as a single character whose size is the ... You can also embed any Tk widget in a Tk Text widget, ...
    (comp.lang.python)
  • Fast text display?
    ... As a hobby project, I'm writing a MUD client -- this scratches an itch, and is also a good excuse to become familiar with the Python language. ... I have a conceptual handle on most of the implementation, but the biggest unknown for me is the seemingly trivial matter of text display. ... I'm not even sure where to start looking to see if a widget that does this has been premade -- the text widgets that I've seen so far have all had documentation geared more towards text editing than pure display. ... In a worst-case scenario, I could try writing a widget-lite with SDL or possibly an OpenGL texture, but if a widget somewhere will already do this then it'd be needless work. ...
    (comp.lang.python)
  • Re: C vs Tcl again...
    ... display the canvas widget is definitely fast ... you mentioned that you may want to display millions ... The beauty is that a 'custom' widget in another language can be called ...
    (comp.lang.tcl)
  • Re: Applying text tags to open channel
    ... to improve the display by adding coloring to specific terms. ... I'm having some difficulty with tags in the text widget. ... My strategy is to regsub the specific term with the term + the tag ... regsub html $data [list html htmltag] ...
    (comp.lang.tcl)