From: Alastair D. <ala...@si...> - 2005-04-18 08:16:54
|
Hello Bill, Kevin, et al. I have run the script Bill posted at the start of this c.l.t thread on = my=20 MacOS X 10.2.8 system (without X11), using Tcl/Tk 8.4.9, about which I = can make the following observations. I double-click the Wish Shell icon and use the "Source" menu command to=20 source the script: the script appears to hang, as described by Bill's=20 friend. I launch the script and Wish together by typing "wish filename" in the=20 Terminal application: the script appears to run OK, after a hiccough. = When=20 it first appears, the main window shimmers, as if it is constantly = re-sizing itself. If I manually catch hold of the re-size handle and adjust its = size=20 slightly, the shimmer ceases. In the first case, it is noticeable that the main window is also = shimmering, but it is not possible to adjust the size manually, hence the = application=20 remains hung. Running the script on Windows XP, I can see that the scrollbars are = arranged differently, and that some extra menu items are present. I will send these observations to mac-tcl list, in the hope of obtaining = further insight. If I get more time to investigate, I will look more closely at the = packing=20 of the scrollbars. Best wishes, Alastair Davies "William J Poser" wrote in message = news:<d3uo0g$114$1...@ne...>... >=20 > The program I asked about is rather long, but here is a stripped down version > consisting of just the GUI. Under GNU/Linux it creates the non-popup windows, > and sets up the menus. With the exception of "Quit", the commands have been > removed. My friend with the Mac says that when he tries to run it it = fails > in exactly the same way as the full program, that is, he sees some pastel-colored > rectangles and then it hangs. >=20 encoding system utf-8 package require msgcat proc _ {s} {return [::msgcat::mc $s]}; # Define shorthand for gettext # Use a virtual event for the right mouse button and # define it differently on the Mac.=20 switch $tcl_platform(platform) { unix - windows { event add <<B3>> <ButtonPress-3> }=20 macintosh { event add <<B3>> <Control-ButtonPress-1> } } set MainFontSize 12; set MainFontFamily Courier; font create MainFont -family $MainFontFamily -size $MainFontSize; font create BalloonHelpFont -family lucida -size 13 -weight normal; set ColorSpecs(cdb,-bg) "\#DDDDFF"; set ColorSpecs(cdt,-bg) "\#e9c4dc"; set ColorSpecs(cdx,-bg) "\#e9c4dc"; set ColorSpecs(gen,-bg) "\#c36176"; set ColorSpecs(.menubar,-bg) "\#c36176"; set ColorSpecs(.menubar,-fg) "\#fee4a9"; set ColorSpecs(.msg,-bg) "\#e9c4dc"; set ColorSpecs(.msg,-fg) "\#000000"; set ColorSpecs(txt,-bg) "\#FFDDDD"; set ColorSpecs(tr,-bg) "\#DDDDFF"; set ColorSpecs(.ipaentry,-bg) "\#FFFFFF"; set ColorSpecs(.ipaentry,-fg) "\#000000"; set ColorSpecs(ipaheadings,-bg) "\#09ffb2"; proc ShutDown {} { exit 0; } proc SetBoth {a b} { .cf.sbarleft set $a $b; .cf.sbarright set $a $b; } proc YViewBoth {args} { set ac [llength $args]; set a [lindex $args 0] set b [lindex $args 1] if {$ac =3D=3D 3} { set c [lindex $args 2] .cf.inp yview $a $b $c; .cf.out yview $a $b $c; } else { .cf.inp yview $a $b; .cf.out yview $a $b; } } set MainWidth 30; set MainHeight 10; frame .top set m [menu .menubar -tearoff 0 -bg $ColorSpecs(.menubar,-bg)\ -fg $ColorSpecs(.menubar,-fg) -font MainFont] $m add cascade -label [_ "File"] -menu [menu $m.file]; $m.file add command -label [_ "Load Input Text"] -command LoadInputText $m.file add command -label [_ "Save Output Text"] -command SaveOutput $m.file add separator $m.file add command -label [_ "Read Transliteration"] -command ReadTransliterationFile; $m.file add command -label [_ "Save Transliteration"] -command SaveTransliteration $m.file add separator $m.file add command -label [_ "Quit"] -command ShutDown $m add command -label [_ "Transliterate"] -command Transliterate; $m add command -label [_ "Clear Input"] -command ClearInputText; $m add command -label [_ "Clear Transliteration"] -command ClearTransliteration; $m add cascade -label [_ "Configure"] -menu [menu $m.configure]; $m.configure add command -label [_ "Disable Irritating Balloon Help"] -command ToggleBalloonHelp; $m add cascade -label [_ "Help"] -menu [menu $m.help]; $m.help add command -label [_ "Bug Reports"] -command BugReports; $m.help add command -label [_ "How To Use This Program"] -command HowTo; $m.help add command -label [_ "Key Bindings"] -command = DescribeKeyBindings; $m.help add command -label [_ "License"] -command ShowGPL; . configure -menu .menubar text .msg -bg $ColorSpecs(.msg,-bg) -fg $ColorSpecs(.msg,-fg) -height 2\ -relief sunken -font MainFont pack .msg -side top -expand 0 -fill x; frame .cf scrollbar .cf.sbarleft -command {YViewBoth} -troughcolor $ColorSpecs(tr,-bg) -bg $ColorSpecs(tr,-bg) -activebackground $ColorSpecs(tr,-bg); scrollbar .cf.sbarright -command {YViewBoth} -troughcolor $ColorSpecs(tr,-bg) -bg $ColorSpecs(tr,-bg) -activebackground $ColorSpecs(tr,-bg); text .cf.inp -yscrollcommand {SetBoth} -width $MainWidth -height $MainHeight -bg $ColorSpecs(tr,-bg); text .cf.out -yscrollcommand {SetBoth} -width $MainWidth -height $MainHeight -bg $ColorSpecs(tr,-bg); pack .cf -expand 1 -fill both pack .cf.sbarleft -side left -expand 0 -fill y pack .cf.sbarright -side right -expand 0 -fill y pack .cf.inp -side left -expand 1 -fill both pack .cf.out -side right -expand 1 -fill both frame .tif=20 frame .tof=20 text .tif.inp -yscrollcommand {.tif.isbar set} -height 10 -bg $ColorSpecs(txt,-bg); text .tof.out -yscrollcommand {.tof.osbar set} -height 10 -bg $ColorSpecs(txt,-bg); scrollbar .tif.isbar -command {.tif.inp yview} -troughcolor $ColorSpecs(txt,-bg) -bg $ColorSpecs(txt,-bg) -activebackground $ColorSpecs(txt,-bg); scrollbar .tof.osbar -command {.tof.out yview} -troughcolor $ColorSpecs(txt,-bg) -bg $ColorSpecs(txt,-bg) -activebackground $ColorSpecs(txt,-bg); pack .tif.isbar -side right -expand 0 -fill y pack .tif.inp -side left -expand 1 -fill both pack .tof.osbar -side right -expand 0 -fill y pack .tof.out -side left -expand 1 -fill both pack .cf -in .top -side top pack .tof -in .top -side bottom -expand 1 -fill both; pack .tif -in .top -side bottom -expand 1 -fill both; pack .top -expand 1 -fill both .cf.inp configure -state normal .cf.out configure -state normal .tif.inp configure -state disabled .tof.out configure -state disabled after idle { update idletasks set w [winfo reqwidth .] set h [winfo reqheight .] wm minsize . $w $h } > --=20 > Bill Poser, Linguistics, University of Pennsylvania > http://www.ling.upenn.edu/~wjposer/ bil...@al... |