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


Groups > comp.lang.python > #83223

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

Newsgroups comp.lang.python
Date 2015-01-04 16:33 -0800
References <e6143cd5-3475-431a-b2cf-17fd9659681c@googlegroups.com>
Message-ID <655cce0d-2db3-4a0d-ab3d-64d5db5e1634@googlegroups.com> (permalink)
Subject Re: apostrophe not considered with tkinter's wordstart and wordend
From Rick Johnson <rantingrickjohnson@gmail.com>

Show all headers | View raw


On Saturday, January 3, 2015 2:28:18 PM UTC-6, ravas wrote:

> Is it possible that this could be added in an upcoming
> version of Python -- or is this a Tk issue?

A quick look at the Tkinter.Text.get source code will answer
that question for you:

py> import inspect
py> from Tkinter import Text
py> print inspect.getsource(Text.get)
    def get(self, index1, index2=None):
        """Return the text from INDEX1 to INDEX2 (not included)."""
        return self.tk.call(self._w, 'get', index1, index2)

As you can see, this method is just a dumb wrapper. There is
no "python-side" processing going on here. Which is true for
just about the entire Tkinter module.

I'm not sure if you can edit the pre-defined "word capture
patterns" that exist within TK (never had the need to find
out), but you could implement any pattern matching you want
by binding the correct events and then processing the
"target string" on the Python side. 

However, i would say that not allowing customization of
patterns is a major flaw of the API, and one more reason why
Tkinter is a rusty old "Clostridium tetani infected" anchor
around Python's neck!

   FOR GUIDO'S SAKE, BE SURE YOUR IMMUNIZATIONS ARE UP TO DATE!

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