#139 tkcvs 8.2.1 invocation problem

open
DorothyR
None
5
2015-01-16
2010-03-18
Gavin Walker
No

I am using tkcvs where my display is a Solaris 10, Citrix server running CDE and when I invoked tkcvs 8.2.1 using tcl/tk 8.5, I got the following error:
--------------------
Error in startup script: expected integer but got "user-medium-r-normal-m*-*-*-*-*-*-*-*-*"
while executing
"font actual $cvscfg(flashfont) -underline"
invoked from within
"if {! [font actual $cvscfg(flashfont) -underline]} {
#puts "Underline font not working. Trying $ffam $fsiz bold"
set cvscfg(flashfont) [list [lin..."
(file "/apps/installmedia/tkcvs/tkcvs-v8.2.1/bin/tkcvs" line 229)
--------------------
Note: no other X Display gave me a problem

So I modified tkcvs in 2 places:
line 146
set hlbg_rgb [winfo rgb .testent $cvsglb(hlbg)]
set cvscfg(listboxfont) [lindex [.testent configure -font] 4]
puts "output of configure for .testent"
puts [.testent configure]
destroy .testent
line 213
set cvscfg(flashfont) $cvscfg(listboxfont)
puts "\n\$cvscfg(listboxfont): $cvscfg(listboxfont)"
set fsiz [lindex $cvscfg(listboxfont) 1]
puts "\$fsiz: $fsiz"
set lbf [font actual $cvscfg(listboxfont)]
puts "actual listboxfont (\$lbf): $lbf\n"
set ffam [lindex $lbf 1]
#set fsiz [lindex $lbf 3]
if {$fsiz == ""} {
# This happens on Windows in tk8.5
set fsiz [lindex $lbf 3]
}

And I modified cde_params.tcl:
line 20:
# If any of these aren't set, I don't think we're in CDE after all
puts "cde_params.tcl: \$fg - \$bg - \$guifont - \$txtfont"
puts "cde_params.tcl: $fg - $bg - $guifont - $txtfont\n"
if {![string length $fg]} {return 0}

The output I got was as follows:
--------------------
cde_params.tcl: $fg - $bg - $guifont - $txtfont
cde_params.tcl: - - -dt-interface system-medium-r-normal-m*-*-*-*-*-*-*-*-*: - -dt-interface user-medium-r-normal-m*-*-*-*-*-*-*-*-*

Output of configure for .testent:
{-background background Background #ffffff #ffffff} {-bd -borderwidth} {-bg -background} {-borderwidth borderWidth BorderWidth 1 1} {-cursor cursor Cursor xterm xterm} {-disabledbackground disabledBackground DisabledBackground #d9d9d9 #d9d9d9} {-disabledforeground disabledForeground DisabledForeground #a3a3a3 #a3a3a3} {-exportselection exportSelection ExportSelection 1 1} {-fg -foreground} {-font font Font TkTextFont {-dt-interface user-medium-r-normal-m*-*-*-*-*-*-*-*-*}} {-foreground foreground Foreground #000000 #000000} {-highlightbackground highlightBackground HighlightBackground #d9d9d9 #d9d9d9} {-highlightcolor highlightColor HighlightColor #000000 #000000} {-highlightthickness highlightThickness HighlightThickness 1 1} {-insertbackground insertBackground Foreground #000000 #000000} {-insertborderwidth insertBorderWidth BorderWidth 0 0} {-insertofftime insertOffTime OffTime 300 300} {-insertontime insertOnTime OnTime 600 600} {-insertwidth insertWidth InsertWidth 2 2} {-invalidcommand invalidCommand InvalidCommand {} {}} {-invcmd -invalidcommand} {-justify justify Justify left left} {-readonlybackground readonlyBackground ReadonlyBackground #d9d9d9 #d9d9d9} {-relief relief Relief sunken sunken} {-selectbackground selectBackground Foreground #c3c3c3 #c3c3c3} {-selectborderwidth selectBorderWidth BorderWidth 0 0} {-selectforeground selectForeground Background #000000 #000000} {-show show Show {} {}} {-state state State normal normal} {-takefocus takeFocus TakeFocus {} {}} {-textvariable textVariable Variable {} {}} {-validate validate Validate none none} {-validatecommand validateCommand ValidateCommand {} {}} {-vcmd -validatecommand} {-width width Width 20 20} {-xscrollcommand xScrollCommand ScrollCommand {} {}}

$cvscfg(listboxfont): -dt-interface user-medium-r-normal-m*-*-*-*-*-*-*-*-*
$fsiz: user-medium-r-normal-m*-*-*-*-*-*-*-*-*
actual listboxfont ($lbf): -family {Luxi Sans} -size 12 -weight normal -slant roman -underline 0 -overstrike 0

Error in startup script: expected integer but got "user-medium-r-normal-m*-*-*-*-*-*-*-*-*"
while executing
"font actual $cvscfg(flashfont) -underline"
invoked from within
"if {! [font actual $cvscfg(flashfont) -underline]} {
#puts "Underline font not working. Trying $ffam $fsiz bold"
set cvscfg(flashfont) [list [lin..."
(file "/apps/installmedia/tkcvs/tkcvs-v8.2.1/bin/tkcvs" line 230)
--------------------

So the problem is that fsiz ends up being "user-medium-r-normal-m*-*-*-*-*-*-*-*-*"

As I am not an expert in TkCVS's code or Tcl/Tk, I decided that the following was probably a reasonable modification to the code as $fsiz should be numeric:
--- tkcvs_8_2_1/tkcvs/tkcvs.tcl 2009-12-21 05:59:37.000000000 +0000
+++ tkcvs-v8.2.1/bin/tkcvs 2010-03-18 16:04:40.183485000 +0000
@@ -214,7 +214,7 @@
#puts "actual listboxfont: $lbf"
set ffam [lindex $lbf 1]
#set fsiz [lindex $lbf 3]
-if {$fsiz == ""} {
+if {$fsiz == "" || ! [string is double $fsiz]} {
# This happens on Windows in tk8.5
set fsiz [lindex $lbf 3]
}

I would be grateful if you could validate this fix.

Many thanks for developing and maintaining this extremely useful application.

Gavin

Discussion

  • Gavin Walker
    Gavin Walker
    2010-03-18

    Sorry - just realised that this is a same as ID 2674557

     
  • DorothyR
    DorothyR
    2011-12-03

    • assigned_to: nobody --> dorothyr
     
  • DorothyR
    DorothyR
    2011-12-03

    I'm pretty sure this is fixed in 8.2.3. Can you try it? - thanks