Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #83180
| From | Peter Otten <__peter__@web.de> |
|---|---|
| Subject | Re: apostrophe not considered with tkinter's wordstart and wordend |
| Date | 2015-01-03 22:06 +0100 |
| Organization | None |
| References | <e6143cd5-3475-431a-b2cf-17fd9659681c@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.17359.1420319198.18130.python-list@python.org> (permalink) |
ravas wrote:
> When I place my mouse over a word (and I press something)
> I want the program to analyze the word.
> Tkinter almost provides the perfect option:
> self.text.get('current wordstart', 'current wordend')
>
> Unfortunately apostrophes are not considered using wordstart and wordend.
> http://infohost.nmt.edu/tcc/help/pubs/tkinter/
> Says:
> "For the purposes of this operation, a word is either
> a string of consecutive letter, digit, or underbar (_) characters,
> or a single character that is none of these types."
>
> The easy work around is to highlight the word and use:
> self.text.get('sel.first', 'sel.last')
>
> However, it seems like it could be an easy improvement
> if we could include the apostrophe in the list of word characters.
> Is it possible that this could be added in an upcoming version of Python
> -- or is this a Tk issue?
I think it is.
<http://www.tcl.tk/man/tcl8.6/TkCmd/text.htm#M41> does not mention a way to
configure the set of word chars either:
"""
?submodifier? wordstart
Adjust the index to refer to the first character of the word containing the
current index. A word consists of any number of adjacent characters that are
letters, digits, or underscores, or a single character that is not one of
these. If the display submodifier is given, this only examines non-elided
characters, otherwise all characters (elided or not) are examined.
"""
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
apostrophe not considered with tkinter's wordstart and wordend ravas <ravas@outlook.com> - 2015-01-03 12:28 -0800
Re: apostrophe not considered with tkinter's wordstart and wordend Peter Otten <__peter__@web.de> - 2015-01-03 22:06 +0100
Re: apostrophe not considered with tkinter's wordstart and wordend Rick Johnson <rantingrickjohnson@gmail.com> - 2015-01-04 16:33 -0800
Re: apostrophe not considered with tkinter's wordstart and wordend ravas <ravas@outlook.com> - 2015-01-05 00:01 -0800
Re: apostrophe not considered with tkinter's wordstart and wordend Rick Johnson <rantingrickjohnson@gmail.com> - 2015-01-05 05:20 -0800
Re: apostrophe not considered with tkinter's wordstart and wordend Christian Gollwitzer <auriocus@gmx.de> - 2015-01-22 23:26 +0100
Re: apostrophe not considered with tkinter's wordstart and wordend Rick Johnson <rantingrickjohnson@gmail.com> - 2015-01-24 18:56 -0800
Re: apostrophe not considered with tkinter's wordstart and wordend ravas <ravas@outlook.com> - 2015-01-24 19:17 -0800
Re: apostrophe not considered with tkinter's wordstart and wordend Rick Johnson <rantingrickjohnson@gmail.com> - 2015-01-24 19:57 -0800
Re: apostrophe not considered with tkinter's wordstart and wordend ravas <ravas@outlook.com> - 2015-01-24 21:20 -0800
csiph-web