Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #84283

Re: apostrophe not considered with tkinter's wordstart and wordend

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Christian Gollwitzer <auriocus@gmx.de>
Newsgroups comp.lang.python
Subject Re: apostrophe not considered with tkinter's wordstart and wordend
Date Thu, 22 Jan 2015 23:26:15 +0100
Organization A noiseless patient Spider
Lines 28
Message-ID <m9rtd8$15e$1@dont-email.me> (permalink)
References <e6143cd5-3475-431a-b2cf-17fd9659681c@googlegroups.com> <655cce0d-2db3-4a0d-ab3d-64d5db5e1634@googlegroups.com> <714d9211-9b50-4e62-a7dd-25ff94a32d8a@googlegroups.com> <f1bcb866-b07f-478d-83a4-dcf4b2b096e5@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 8bit
Injection-Date Thu, 22 Jan 2015 22:25:44 +0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="52ac7a71250a76d941bcb5c514e0f16a"; logging-data="1198"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/THKj3HjfHRnkJVxF6Qp8n2FD8BKiwznI="
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:31.0) Gecko/20100101 Thunderbird/31.3.0
In-Reply-To <f1bcb866-b07f-478d-83a4-dcf4b2b096e5@googlegroups.com>
Cancel-Lock sha1:3wsyq958Lk2tebxsG9SAbAbukcc=
Xref csiph.com comp.lang.python:84283

Show key headers only | View raw


Am 05.01.15 um 14:20 schrieb Rick Johnson:
> *GASP*! Of course all this could be avoided if those short-
> sighted TK folks would have allowed the programmer to define
> the pattern!
>
> ಠ_ಠ

Well, it turns out you actually can. We don't have Guido's time machine, 
but still there is a configuration option in Tk, albeit a very obscure 
one: you have to set the global Tcl variables tcl_wordchars and 
tcl_nonwordchars after loading Tk to a regexp which defines the word 
boundaries:

	http://wiki.tcl.tk/1655

Strangely, there is a different preset for Windows and X11. The Windows 
preset - consider everything besides space as part of the word - makes 
more sense to me than the Unix default, which only counts letters, 
numbers and underscores as part of the word. To set the Windows preset, 
do this:

tk.eval('set tcl_wordchars {\S}');
tk.eval('set tcl_nonwordchars {\s}');

(untested in Python, only tested directly from a wish shell)


	Christian

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


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