[tcltk-perl] how to extract perlTk support to separate files (modules)
Brought to you by:
hobbs
From: Konovalov, V. <vko...@sp...> - 2004-04-23 07:46:18
|
Once we have now every type of perlTk widget to live on its own package -- (Button in Tcl::Tk::Widget::Button and so on), it will be extremely easy to separate those into separate module and have them removed from Tk.pm file. Say, create files ./lib/Tcl/Tk/Widget/Menu.pm ./lib/Tcl/Tk/Widget/Menubutton.pm put proper text in there (we already have text in $Tcl::Tk::VTEMP), put there methods (those are currently arguments to "create_method_in_widget_package") and here it is. Need only to replace in those subroutines $wint{$$wid} with more correct $wid->interp After small addition to Tcl::Tk::Widget::AUTOLOAD widget package will be loaded on demand. Right now, Tk.pm is small enough, and I think there's no real need to remove something yet. Module could grow twice its size, then we'll move out documentation to Tcl::Tk.pod file. However I'll move one or more Tix widgets to see how it works and to create a sample way for other widgets to follow. First candidate is Tix's Balloon widget. If anyone have ideas, please let me know. Best regards, Vadim. |