dgw::basegui - toplevel widget as starting point for writing Tk applications
A snit type to build up larger Tk applications, provides standard menu, console, autoscroll, balloon help, and other tools to simplify building Tk application. Is a worki in progess (WIP). See the HTML - manual on how to use it and on how to extend your applications on the base of dgw::basegui.
Example
The following simple code inherits from dgw::basegui and adds a scrolled text editor window.
package require dgw::basegui
snit::type EditorApp {
component basegui
# inheritance
delegate method * to basegui
delegate option * to basegui
# variable addon to extend basegui
variable textw
constructor {args} {
install basegui using dgw::basegui %AUTO%
$self configurelist $args
# added functionality
set f [$basegui getFrame]
set textw [text $f.t -wrap none]
$self autoscroll $textw
}
# added functionality
# access functionality of the text widget
# like:
# app text insert end "hello basegui world"
method text {args} {
$textw {*}$args
}
}
if {[info exists argv0] && $argv0 eq [info script]} {
# start the editor
EditorApp app
app text insert end "Hello EditorApp!!"
}
Attachments:
- basegui.png [download] added by dgroth on 2020-01-18 09:03:27. [details]