Dear all,version I implemented :
I played a little bit around of using TclOO for the creation of megawidgets. Usually I use snit, but TclOO offers the benefit of redefining methods at runtime. Using TclOO from my side for the first time everything was straight forward. In my second
- inheritance
- composition
- mixins
Please have a look at the manual
https://htmlpreview.github.io/?https://raw.githubusercontent.com/mittelmark/oowidgets/master/tutorial.html
and the project page:
https://github.com/mittelmark/oowidgets
For discussion you could use the Wikipage:
https://wiki.tcl-lang.org/page/oowidgets
Currently the package only contains the required code to build your own megawidgets, and a few examples on how to do so.
Feedback welcome.
If I have missed an existing package which does a similar thing, please tell me.
On 3/20/23 08:51, D Groth wrote:version I implemented :
Dear all,
I played a little bit around of using TclOO for the creation of megawidgets. Usually I use snit, but TclOO offers the benefit of redefining methods at runtime. Using TclOO from my side for the first time everything was straight forward. In my second
- inheritance
- composition
- mixins
Please have a look at the manual
https://htmlpreview.github.io/?https://raw.githubusercontent.com/mittelmark/oowidgets/master/tutorial.html
and the project page:
https://github.com/mittelmark/oowidgets
For discussion you could use the Wikipage:
https://wiki.tcl-lang.org/page/oowidgets
Currently the package only contains the required code to build your own megawidgets, and a few examples on how to do so.
Feedback welcome.
If I have missed an existing package which does a similar thing, please tell me.Have you wrapped the existing widgets?
For some related prototyping, see: https://chiselapp.com/user/gwlester/repository/PTK/index
If I have missed an existing package which does a similar thing, please tell me.
On 20/03/2023 14:51, D Groth wrote:
If I have missed an existing package which does a similar thing, please tell me.Tk comes with the ::tk::Megawidget class, which at first glance seems to
do something similar.
Schelte.
Dear all,version I implemented :
I played a little bit around of using TclOO for the creation of megawidgets. Usually I use snit, but TclOO offers the benefit of redefining methods at runtime. Using TclOO from my side for the first time everything was straight forward. In my second
- inheritance
- composition
- mixins
If I have missed an existing package which does a similar thing, please tell me.
Am 20.03.23 um 14:51 schrieb D Groth:version I implemented :
Dear all,
I played a little bit around of using TclOO for the creation of megawidgets. Usually I use snit, but TclOO offers the benefit of redefining methods at runtime. Using TclOO from my side for the first time everything was straight forward. In my second
- inheritance
- composition
- mixins
If I have missed an existing package which does a similar thing, please tell me.
Maybe also have a look at "snot", which is a reimplementation (not 1:1)
of Snit in TclOO. Looks very promising to me:
http://chiselapp.com/user/aspect/repository/snot/dir?ci=tip
Christian
Christian Gollwitzer schrieb am Montag, 20. März 2023 um 19:20:28 UTC+1:second version I implemented :
Am 20.03.23 um 14:51 schrieb D Groth:
Dear all,
I played a little bit around of using TclOO for the creation of megawidgets. Usually I use snit, but TclOO offers the benefit of redefining methods at runtime. Using TclOO from my side for the first time everything was straight forward. In my
arguing that knowing oo::class better opens more possibilities outside of megawidget creation ;)- inheritance
- composition
- mixins
If I have missed an existing package which does a similar thing, please tell me.
Maybe also have a look at "snot", which is a reimplementation (not 1:1)
of Snit in TclOO. Looks very promising to me:
http://chiselapp.com/user/aspect/repository/snot/dir?ci=tip
ChristianThanks Christian,
I knew this project before, but having another syntax to learn was something I did not like at that time. My goal was to have a widget creation framework which does not introduce a new syntax. That's one of the reasons I was looking into oo::class,
At the bottom of the Readme: https://github.com/mittelmark/oowidgets I have a comparison of a snit vs a oowidget, the latter is much easier to read for someone coding in TclOO. The only non TclOO syntax is the class declaration using oowidgets::widgetsinstead of oo::class create ... (callback instead of mymethod will be introduced with 8.7).
I will add a few more examples of real megawidgets later, currently just two a dlabel based on ttk::label and a composite widget based on label, frame and progressbar..
Detlef
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 428 |
Nodes: | 16 (2 / 14) |
Uptime: | 108:48:43 |
Calls: | 9,053 |
Files: | 13,395 |
Messages: | 6,015,910 |