Version 6 of Tip 556: Add oo like widgets to Tk

Updated 2020-01-30 08:24:27 by RZ

This page is for discussion of Tip 556

You can find linux and windows tclkits at https://sourceforge.net/projects/kbskit/files/tip556/

With the implementation you can:

  • create oo class like widgets in C (tko::frame, tko::labelframe and tko::toplevel are included)
  • oo class like widget as superclass and extend it (tko initfrom ?tkoclass?)
  • wrap existing widgets in oo class like widgets (tko initwrap ..)
  • create to oo classes with option handling (tko initclass)
  • dynamically add, delete, show and hide options at class (tko option* ..) and object level (my _tko option* ..)

bll 2019-12-18: Is there a proof-of-concept example widget?


RZ - 2019-12-18 15:16:53

::tko::frame ::tko::labelframe and ::tko::toplevel with same functionality like original widgets. See also in the man page tko.n

I have also a rbc graph widget ready. I will tip it after this tip gets accepted. Should I include it in the ready to run tclkits?

oo::class create W {::tko initfrom ::tko::frame}
oo::define W method xy {args} {puts $args}
W .w
.w xy

GWL - 2020-01-23

See the OO implementation, in pure Tcl, of PTk for additional ideas.

RZ will do. thanks