Updated 2017-08-28 19:13:33 by SEH

A megawidget is a widget that is composed of other widgets and encapsulated in its own space. It should behave according to the principles set out by the standard Tk widgets, being able to be manipulated by invoking methods on its pathname, being constructed in the standard way, supporting options through configure and cget methods, participating in geometry management, focus traversal, event handling, etc.

See Also  edit

An essential tool for creating a megawidget.
What is a Megawidget
Composite fields megawidgets
a code snippet for specifying composite fields
Useful Tk Widgets
a catalog of widgets and megawidgets
Adding User Data to Widgets the Megawidget Way
Megawidgets with TclOO
Mumbling over a mega widget framework
A New Megawidget Library
a discussion about political strategy for organizing a megawidget project

Reference  edit

In Search of the Perfect Mega-widget, Stephen A. Uhler, Fourth Annual Tcl/Tk Workshop, 1996

Description  edit

snit provides a framework for creating megawidgets. I don't know whether there are any megawidgets actually in there, but certainly people are using the snit code to build them.

Libraries  edit

Agentk Widgets
fade, ticket, navigation bar, roll, anthropomorphic
table, graph, barchart, tree, tabset, htext etc.
a popular widget library
incr Widgets
based on incr Tk
based on incr tcl
Snit based megawidget package that is part of Athena
MegaWidget package
fully-transparent Tk megawidgets
a widget framework, but comes with some demonstration widgets
community-maintained library of Tk widgets and utilities

Examples  edit

Namespace MegaWidgets by NEM
someone in the Tcl Chatroom asked for a simple example of a megawidget
overloading widgets by RS

Tools  edit

megawidget framework with tclOO (1)
MIT otcl megawidget system
A simple otcl megawidget system.
Snit's Not Incr Tcl, by Will Duquette
One of the most popular [object systems] and megawidget frameworks.
it's not snit. TclOO megawidget framework inspired by snit in less than a thousand lines of code.
A framework based on Ttk.
a widget class for XOTcl

Misc  edit

LV: there are certainly examples here on the wiki of snit widgets. Perhaps the authors would consider working with the tklib maintainers to have them incorporated into tklib? What about other widgets or procs that would provide a Tk developer useful tools? Any authors of such software willing to visit http://tcllib.sf.net/ and submit Feature Requests to have your software included? Anyone a fan of any specific Tk related procs/packages that would be useful for developing Tk applications? You could contact the author to see if they would be willing to allow their code to be included in tklib.

NEM 2004-02-26 1: I am currently working on a CSS parser, which will then lead on to work to create CSS megawidgets based around the text widget and the canvas (which is more work, and so much longer term). The CSS parser is pure Tcl, should be finished some time in the next month (it probably has about 2 days more work left + testing, but finding the time...), and I will be submitting it for inclusion in tcllib when finished. The megawidgets will probably be written using snit, and might find their way in to tklib at some point. Combined with tdom or TclXML these might make a decent alternative to tkhtml with support for more recent (XML-based) web standards. Much work to do though.