Re: reusing "code entities" without oop
- From: Jeff Hobbs <jeffh@xxxxxxxxxxxxxxx>
- Date: Thu, 29 Mar 2007 11:52:58 -0700
Stephen M. Gava wrote:
Since we've been evaluating tcl/tk for a project I've found it asserted in several places in documentation that most things that you might use oop for in other languages are achievable in a non oop way in tcl.
In python for instance (using tkinter) you might make a tailored tk control, or even a whole toplevel with all its functionality, an object. You can then instantiate this object any number of times as a way of reusing this packaged functionality.
What would be the "standard" (non oop) tcl way of acheiving this outcome, or would the best answer be to use one of the oop "addons" for this purpose?
The reason I ask is that the simplicity of pure tcl/tk is compelling for deployment reasons, but if things like the "instantiation effect" need non core addons then it probably makes more sense for us to go with a combination of python (which we are more familliar with) and tk (via tkinter).
While OO is often overused, it is actually useful in UI programming and for the building of megawidgets in particular. I would recommend using the 'snit' module in tcllib (part of ActiveTcl). It is conceptually clean and easier to use. You will find examples of snit widgets in the tklib 'widget' package (also in ActiveTcl).
Jeff
.
- Follow-Ups:
- Re: reusing "code entities" without oop
- From: Cameron Laird
- Re: reusing "code entities" without oop
- References:
- reusing "code entities" without oop
- From: Stephen M. Gava
- reusing "code entities" without oop
- Prev by Date: Re: scrollbar question
- Next by Date: Re: Need help with high-level tcltest wrapper for rapid test creation
- Previous by thread: Re: reusing "code entities" without oop
- Next by thread: Re: reusing "code entities" without oop
- Index(es):
Relevant Pages
|