brad.lanam.comp _at_ gmail.com Currently unemployed. Tcl/Tk, C, perl, php, shell, MySQL/MariaDB, HTML, CSS, porting, legacy systems, system administration. website: https://gentoo.com/ (registered 1992-03-26) No, this is not gentoo linux, they're at http://gentoo.org/ (registered 1999-10-04). https://ballroomdj.org/ '''CV''' * B.S. Computer Science, minor in mathematics. * Debit/Credit processing system. ** Seattle installation: Running on OS/2 in 35 grocery stores, all communicating to the same software running on SCO Unix at corporate which sent the transactions on to the bank. ** California drug store: Handled 14 transactions per second processing checks. * Wrote the communications protocol for the California Smog Check 2 project. * Wrote the online epub reader for Apress utilizing Sphinx Search to search the entire Apress library. '''Projects:''' [BallroomDJ]: A ballroom music player written in tcl/tk. SourceForge: https://sourceforge.net/u/bll123/profile/ * BallroomDJ ** https://sourceforge.net/p/ballroomdj/ ** Home page: https://ballroomdj.org/ ** wiki: [BallroomDJ] * di - disk information utility ** includes a Tcl interface ** https://sourceforge.net/p/diskinfo-di/ ** Home page: https://gentoo.com/di/ ** wiki: [Filesystem Usage / Information: di Tcl extension] * mkconfig - build configuration utility (written in portable Bourne Shell, not Tcl) ** https://sourceforge.net/p/mkconfig/ ** Home page: https://gentoo.com/di/mkconfig.html * tcl-combobox-enhanced ** https://sourceforge.net/p/tcl-combobox-enhanced/ ** wiki: [ComboBox megawidget with adjusted width] ** wiki: [ComboBox megawidget - return associated values] * tcl-checkbuttontoggle ** https://sourceforge.net/p/tcl-checkbuttontoggle/ ** wiki: [ttk::checkbutton as toggle switch display] * tcl-collate ** https://sourceforge.net/projects/tcl-collate/ ** wiki: [Collation] ** wiki: [locale package] * tcl-direntry ** https://sourceforge.net/p/tcl-direntry/ ** wiki: [Directory entry megawidget] * tcl-virtualscrolling ** https://sourceforge.net/p/tcl-virtualscrolling/ ** wiki: [Virtual Scrolling] * volume-controls-cmdline ** https://sourceforge.net/projects/volume-controls-cmdline/ ** wiki: [Linux: volume control] ** wiki: [Windows XP: volume control] ** wiki: [Mac OS X: volume control] * tcl-lspinbox ** https://sourceforge.net/projects/tcl-lspinbox/ ** wiki: [Localized, Scalable Spinbox Widget] All code I post here is under the zlib/libpng License. '''Created Pages:''' * [User Interface Design: Sizing of Elements] * [Virtual Scrolling] * [Combobox Enhancements] * [Changing Widget Colors] * [Color palettes for ttk] * [Filesystem Usage / Information: di Tcl extension] * [ttk::checkbutton as toggle switch display] * [Scaled checkbutton] * [Tk differences on Mac OS X] * [Windows: volume control] * [Linux: volume control] * [Windows XP: volume control] * [VLC Tcl Extension] * [Mac OS X: volume control] * [List of ttk Themes] * [Yet Another Color Picker] * [onDisplay - run a script after a window is displayed] * [Tutorial: Converting synchronous HTTP requests to event driven code] * [ComboBox megawidget with adjusted width] * [ComboBox megawidget - return associated values] * [Directory entry megawidget] * [Toggle Button with indicator] * [Tutorial: Modifying a ttk button's style] * [MPV Tcl Extension] * [waldorf ttk theme] * [black ttk theme] * [list ensemble] * [locale package] * [Localized, Scalable Spinbox Widget] * [Scaled Radiobutton] Major Contribution: * [Collation] ---- Bugs filed: Window screen height/width returns height/width of primary display: [http://core.tcl.tk/tk/tktview/c95d4691ff8723b47c820081ce50688cf04911f7] Putting a window into fullscreen mode moves the window to the primary display: [http://core.tcl.tk/tk/tktview/4face822b0b3d0cb8383c5cf46ff2099715846fa] Workaround: ====== set vx [winfo vrootx .] ; # so we can tell if monitors are 1-2 or 2-1 set vy [winfo vrooty .] wm state $w zoomed set nsh [winfo reqheight $w] set nsw [winfo reqwidth $w] wm overrideredirect $w yes if { $vx < 0 } { set nx $vx } else { set sw [winfo screenwidth .] set nx [expr {$sw+1}] } set ny 0 wm geometry $w ${nsw}x${nsh}+$nx+0 ====== ---- Workaround for bug in 8.6.3 tk_getOpenFile: ====== # work around 8.6.3 bug if { $fn == {} || [regexp {^after#} $fn] } { return } ====== ---- Notes: ---- Using update rather than update idletasks prevents windows from putting the tk window into a not responding state. ---- Windows starts up the tcl scripts with wish, which uses the wish icon. Starting with tclsh uses the icon set using 'wm iconbitmap'. So to get the wanted icon to display, restart the program with tclsh. ====== package require Tk set tclsh [info nameofexecutable] if { [regexp {wish\d*.exe} $tclsh] } { regsub {wish\d*.exe} $tclsh tclsh.exe tclsh exec $tclsh [info script] & exit } wm iconbitmap . -default [file join $myimages bdj_icon.ico] ====== ---- wm iconphoto only works with .gif files on windows, and only seems to allow a single image (despite the documentation). ---- ActiveState Tcl/Tk doesn't seem to get a dock icon. Everything seems to work with MacPorts Tcl/Tk. Mac OSX application name in menubar: a) Symlink the application name to the wish executable. a1) It seems that CFBundleExecutable has to be the same name as the application name (this seems a bit odd -- the python examples don't have this issue). a2) I needed to run wish during the installation to get the real wish executable path. It seems that stdout gets completely lost. I had to open a file and save the output there, then I could retrieve the information from the output file in the postinstall script. a3) [info nameofexecutable] will return the symlink in (a). b) Create Resources/Scripts/AppMain.tcl. This script is executed when (a) is run. Always. So I use: ====== set script [file normalize [file join \ [file dirname [file dirname [file dirname [info script]]]] \ MacOS MyApp.tcl]] if { $argc > 0 } { set script [lindex $::argv 0] set ::argv [lrange $::argv 1 end] } source $script ====== so that the appropriate script is run. This does have the advantage that the application name in the menubar stays intact. In general (from what I've read) it seems that the python users using the symlink trick have fewer problems getting their application name in the menubar. CFBundleExecutable doesn't have to match the application name, there's no startup script. Why is tk more complicated? ---- Why shrinking a window doesn't shrink the widget you want it to: https://groups.google.com/forum/#!topic/comp.lang.perl.tk/ZYD71t2tYDk It would be nice if there was a way to configure this. Why doesn't shrinking the window honor the '-expand true' flags? (Expanding the window honors the weight/expand flags. Shrinking the window uses the packing order of the widgets) <> Person