# ---------------------------------------------------------------------------- # init.tcl # This file is part of Unifix BWidget Toolkit # $Id: init.tcl,v 1.92 2009/10/25 20:55:36 oberdorfer Exp $ # ---------------------------------------------------------------------------- # namespace eval Widget {} proc Widget::_opt_defaults {{prio widgetDefault}} { if {$::tcl_version >= 8.4} { set plat [tk windowingsystem] } else { set plat $::tcl_platform(platform) } switch -exact $plat { "aqua" { } "win32" - "windows" { option add *ListBox.background SystemWindow $prio #option add *Button.padY 0 $prio option add *ButtonBox.padY 0 $prio option add *Dialog.padY 0 $prio option add *Dialog.anchor e $prio } "x11" - default { option add *Scrollbar.width 12 $prio option add *Scrollbar.borderWidth 1 $prio option add *Dialog.separator 1 $prio option add *MainFrame.relief raised $prio option add *MainFrame.separator none $prio } } } Widget::_opt_defaults if {[catch {package require msgcat}]} { # Error thrown - package not found. option read [file join $::BWIDGET::LIBRARY "lang" "en.rc"] } else { # package loaded namespace import msgcat::* msgcat::mcload [file join $::BWIDGET::LIBRARY "lang"] source [file join $::BWIDGET::LIBRARY "lang" "xopt.tcl"] } # Add a TraverseIn binding to standard Tk widgets to handle some of # the BWidget-specific things we do. bind Entry <> { %W selection range 0 end; %W icursor end } bind Spinbox <> { %W selection range 0 end; %W icursor end } bind all { Widget::traverseTo [Widget::focusNext %W] } bind all <> { Widget::traverseTo [Widget::focusPrev %W] } ::BWidget::createSystemFonts ::BWidget::set_themedefaults "default"