[Tutor] tkinter event question

Glen Wheeler wheelege@hotmail.com
Sat, 23 Feb 2002 18:38:14 +1100


>
> You can also use unbind_class().  Unfortunately, it affects every Text
> widget, but it's about the only way to handle the 'default' effect.
>
> There are other advantages of using Entry over Text - if you want a Tab-
> advancing form, Entry widgets will be more friendly.
>

  Hmm, ok.  I've converted the one-line fields where I want to bind return
to entry-s, but for purely academic reasons (and curiosity) would creating a
new class which inherited from Text, changed next to nothing, and then
unbind_class()-ing that?  I'm not sure, as I've never tried it but it feels
to me like that could work.  The only thing that might make it fail is that
there is only one Text widget in tk and unbind_class may either a) not work
on the new class which inherits from Text or b) unbind all the text widgets
anyway.
  Hackish ways come to mind to make this work though, using
unbind_class...it's all very interesting, but not too productive.  Should
help my understanding of tcl/tk at any rate :)

  Thanks,
  Glen