Hi everybody,
I'm looking for some directions, while programming a very simple
editor (supporting basic formatting)

The window where the user writes is a Text widget (named: text), where
I put a tag 'b' to set the text where this tag applies to bold.

This is not a problem when I apply the bold to a selection:

text.tag_add('b', SEL_FIRST,SEL_LAST)

I have instead two problems when I just want to switch on/off the bold
while typing. To switch it on the only way I found is this:

text.insert(INSERT, '  ', 'b' )
text.mark_set("insert", INSERT+'-1c')

notice that I have to insert TWO spaces. If I insert one, the bold
doesnt apply. If I insert '', my cursor goes back one char!

My second problem is how to switch it off, when I'm writing within a
bolded region - and for this I havent the slightest idea...

Thanks for any help!


alessandro
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to