From 019c0e56579fe7f94982434d8efcd7b00d8df0aa Mon Sep 17 00:00:00 2001 From: Miller Puckette Date: Fri, 28 Dec 2007 03:43:06 +0000 Subject: ... and again trying to check in 0.41-0 test 10 svn path=/trunk/; revision=9108 --- pd/src/u_main.tk | 670 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 402 insertions(+), 268 deletions(-) (limited to 'pd/src/u_main.tk') diff --git a/pd/src/u_main.tk b/pd/src/u_main.tk index be87b8f5..08d429a1 100644 --- a/pd/src/u_main.tk +++ b/pd/src/u_main.tk @@ -1,14 +1,4 @@ #!/usr/bin/wish - -# set pd_nt (bad name) 0 for unix, 1 for microsoft, and 2 for Mac OSX. -if { $tcl_platform(platform) == "windows" } { - set pd_nt 1 -} elseif { $tcl_platform(os) == "Darwin" } { - set pd_nt 2 -} else { - set pd_nt 0 -} - # Copyright (c) 1997-1999 Miller Puckette. # For information on usage and redistribution, and for a DISCLAIMER OF ALL # WARRANTIES, see the file, "LICENSE.txt," in this distribution. @@ -21,6 +11,39 @@ if { $tcl_platform(platform) == "windows" } { # # all this changes are labeled with #######iemlib########## +# set pd_nt (bad name) 0 for unix, 1 for microsoft, and 2 for Mac OSX. +if { $tcl_platform(platform) == "windows" } { + set pd_nt 1 + set defaultFontFamily {Bitstream Vera Sans Mono} + set defaultFontWeight normal + font create menuFont -family Tahoma -size -11 +} elseif { $tcl_platform(os) == "Darwin" } { + set pd_nt 2 + set defaultFontFamily Monaco + set defaultFontWeight normal +} else { + set pd_nt 0 + set defaultFontFamily Courier + set defaultFontWeight bold +} + +# start Pd-extended font hacks ----------------------------- + +# Pd-0.39.2-extended hacks to make font/box sizes the same across platform +# puts stderr "tk scaling is [tk scaling]" +# tk scaling 1 + +# this font is for the Pd Window console text +font create console_font -family $defaultFontFamily -size -12 \ + -weight $defaultFontWeight +# this font is for text in Pd windows +font create text_font -family {Times} -size -14 -weight normal +# for text in Properties Panels and other panes +font create highlight_font -family $defaultFontFamily -size -14 -weight bold + +# end Pd-extended font hacks ----------------------------- + + # Tearoff is set to true by default: set pd_tearoff 1 @@ -44,11 +67,7 @@ if {$pd_nt == 1} { if {$pd_nt == 2} { # turn on James Tittle II's fast drawing set tk::mac::useCGDrawing 1 - # set minimum line size for anti-aliasing. If set to 1 or 0, then every - # line will be anti-aliased. While this makes connections and circles in - # [bng] and such look really good, it makes boxes and messages look out of - # focus. Setting this to 2 makes it so the thick audio rate connections - # are anti-aliased. 2005-06-09 +# anti-alias all lines that need it set tk::mac::CGAntialiasLimit 2 global pd_guidir global pd_tearoff @@ -132,6 +151,15 @@ if {$pd_nt != 2} { .mbar add cascade -label "Help" -menu .mbar.help } +# fix menu font size on Windows with tk scaling = 1 +if {$pd_nt == 1} { + .mbar.file configure -font menuFont + .mbar.find configure -font menuFont + .mbar.windows configure -font menuFont + .mbar.audio configure -font menuFont + .mbar.help configure -font menuFont +} + set ctrls_audio_on 0 set ctrls_meter_on 0 set ctrls_inlevel 0 @@ -140,15 +168,14 @@ set ctrls_outlevel 0 frame .controls.switches checkbutton .controls.switches.audiobutton -text {compute audio} \ -variable ctrls_audio_on \ - -anchor w \ -command {pd [concat pd dsp $ctrls_audio_on \;]} checkbutton .controls.switches.meterbutton -text {peak meters} \ -variable ctrls_meter_on \ - -anchor w \ -command {pd [concat pd meters $ctrls_meter_on \;]} -pack .controls.switches.audiobutton .controls.switches.meterbutton -side top +pack .controls.switches.audiobutton .controls.switches.meterbutton \ + -side top -anchor w frame .controls.inout frame .controls.inout.in @@ -175,7 +202,7 @@ pack .controls.dio -side right -padx 20 frame .printout -text .printout.text -relief raised -bd 2 -font -*-courier-bold--normal--12-* \ +text .printout.text -relief raised -bd 2 -font console_font \ -yscrollcommand ".printout.scroll set" -width 80 # .printout.text insert end "\n\n\n\n\n\n\n\n\n\n" scrollbar .printout.scroll -command ".printout.text yview" @@ -365,7 +392,7 @@ proc menu_opentext {filename} { global pd_myversion set name [format ".help%d" $doc_number] toplevel $name - text $name.text -relief raised -bd 2 -font -*-times-regular--normal--14-* \ + text $name.text -relief raised -bd 2 -font text_font \ -yscrollcommand "$name.scroll set" -background white scrollbar $name.scroll -command "$name.text yview" pack $name.scroll -side right -fill y @@ -387,9 +414,16 @@ proc menu_openhtml {filename} { global pd_nt if {$pd_nt == 0} { - exec sh -c \ - [format "firefox file:%s || mozilla file:%s " \ - $filename $filename] & + foreach candidate \ + { gnome-open xdg-open sensible-browser iceweasel firefox mozilla \ + galeon konqueror netscape lynx } { + set browser [lindex [auto_execok $candidate] 0] + if {[string length $browser]} { + puts stderr [format "%s %s" $browser $filename] + exec -- sh -c [format "%s %s" $browser $filename] & + break + } + } } elseif {$pd_nt == 2} { puts stderr [format "open %s" $filename] exec sh -c [format "open %s" $filename] @@ -1143,6 +1177,18 @@ proc pdtk_canvas_new {name width height geometry editable} { $name.popup add command -label {Help} \ -command [concat popup_action $name 2] +# fix menu font size on Windows with tk scaling = 1 +if {$pd_nt == 1} { + $name.m.file configure -font menuFont + $name.m.edit configure -font menuFont + $name.m.find configure -font menuFont + $name.m.put configure -font menuFont + $name.m.windows configure -font menuFont + $name.m.audio configure -font menuFont + $name.m.help configure -font menuFont + $name.popup configure -font menuFont +} + # WM protocol wm protocol $name WM_DELETE_WINDOW [concat menu_close $name] @@ -1162,6 +1208,7 @@ proc pdtk_canvas_new {name width height geometry editable} { bind $name.c {pdtk_canvas_click %W %x %y %b 4} bind $name.c {pdtk_canvas_click %W %x %y %b 5} bind $name.c {pdtk_canvas_click %W %x %y %b 6} + bind $name.c {pdtk_canvas_click %W %x %y %b 6} bind $name.c \ {pdtk_canvas_click %W %x %y %b 7} } else { @@ -1267,6 +1314,7 @@ proc pdtk_array_listview_new {id arrayName page} { global pd_nt global pd_array_listview_page global pd_array_listview_id + global fontname fontweight set pd_array_listview_page($arrayName) $page set pd_array_listview_id($arrayName) $id set windowName [format ".%sArrayWindow" $arrayName] @@ -1280,8 +1328,7 @@ proc pdtk_array_listview_new {id arrayName page} { set $windowName.lb [listbox $windowName.lb -height 20 -width 25\ -selectmode extended \ -relief solid -background white -borderwidth 1 \ - -font [format -*-courier-bold--normal--%d-* \ - $font] \ + -font [format {{%s} %d %s} $fontname $font $fontweight]\ -yscrollcommand "$windowName.lb.sb set"] set $windowName.lb.sb [scrollbar $windowName.lb.sb \ -command "$windowName.lb yview" -orient vertical] @@ -1385,9 +1432,7 @@ proc pdtk_array_listview_paste {arrayName} { proc pdtk_array_listview_edit {arrayName page font} { global pd_array_listview_entry global pd_nt - if {$pd_nt == 0} { - set font [expr $font - 2] - } + global fontname fontweight set lbName [format ".%sArrayWindow.lb" $arrayName] if {[winfo exists $lbName.entry]} { pdtk_array_listview_update_entry \ @@ -1399,7 +1444,7 @@ proc pdtk_array_listview_edit {arrayName page font} { set bbox [$lbName bbox $itemNum] set y [expr [lindex $bbox 1] - 4] set $lbName.entry [entry $lbName.entry \ - -font [format -*-courier-bold--normal--%d-* $font]] + -font [format {{%s} %d %s} $fontname $font $fontweight]] $lbName.entry insert 0 [] place configure $lbName.entry -relx 0 -y $y -relwidth 1 lower $lbName.entry @@ -1875,6 +1920,8 @@ proc pdtk_gatom_dialog {id initwidth initlo inithi \ set vid [string trimleft $id .] + global pd_nt + set var_gatomwidth [concat gatomwidth_$vid] global $var_gatomwidth set var_gatomlo [concat gatomlo_$vid] @@ -1899,87 +1946,96 @@ proc pdtk_gatom_dialog {id initwidth initlo inithi \ set $var_gatomsymto [gatom_unescape $symto] toplevel $id - wm title $id {Atom} + wm title $id "atom box properties" + wm resizable $id 0 0 wm protocol $id WM_DELETE_WINDOW [concat dogatom_cancel $id] - frame $id.buttonframe - pack $id.buttonframe -side bottom -fill x -pady 2m + frame $id.params -height 7 + pack $id.params -side top + label $id.params.entryname -text "width" + entry $id.params.entry -textvariable $var_gatomwidth -width 4 + pack $id.params.entryname $id.params.entry -side left + + labelframe $id.limits -text "limits" -padx 15 -pady 4 -borderwidth 1 \ + -font highlight_font + pack $id.limits -side top -fill x + frame $id.limits.lower + pack $id.limits.lower -side left + label $id.limits.lower.entryname -text "lower" + entry $id.limits.lower.entry -textvariable $var_gatomlo -width 8 + pack $id.limits.lower.entryname $id.limits.lower.entry -side left + frame $id.limits.upper + pack $id.limits.upper -side left + frame $id.limits.upper.spacer -width 20 + label $id.limits.upper.entryname -text "upper" + entry $id.limits.upper.entry -textvariable $var_gatomhi -width 8 + pack $id.limits.upper.spacer $id.limits.upper.entryname \ + $id.limits.upper.entry -side left + + frame $id.spacer1 -height 7 + pack $id.spacer1 -side top + + labelframe $id.label -text "label" -padx 5 -pady 4 -borderwidth 1 \ + -font highlight_font + pack $id.label -side top -fill x + frame $id.label.name + pack $id.label.name -side top + entry $id.label.name.entry -textvariable $var_gatomlabel -width 33 + pack $id.label.name.entry -side left + frame $id.label.radio + pack $id.label.radio -side top + radiobutton $id.label.radio.left -value 0 \ + -variable $var_gatomwherelabel \ + -text "left " -justify left + radiobutton $id.label.radio.right -value 1 \ + -variable $var_gatomwherelabel \ + -text "right" -justify left + radiobutton $id.label.radio.top -value 2 \ + -variable $var_gatomwherelabel \ + -text "top" -justify left + radiobutton $id.label.radio.bottom -value 3 \ + -variable $var_gatomwherelabel \ + -text "bottom" -justify left + pack $id.label.radio.left -side left -anchor w + pack $id.label.radio.right -side right -anchor w + pack $id.label.radio.top -side top -anchor w + pack $id.label.radio.bottom -side bottom -anchor w + + frame $id.spacer2 -height 7 + pack $id.spacer2 -side top + + labelframe $id.s_r -text "messages" -padx 5 -pady 4 -borderwidth 1 \ + -font highlight_font + pack $id.s_r -side top -fill x + frame $id.s_r.paramsymto + pack $id.s_r.paramsymto -side top -anchor e + label $id.s_r.paramsymto.entryname -text "send symbol" + entry $id.s_r.paramsymto.entry -textvariable $var_gatomsymto -width 21 + pack $id.s_r.paramsymto.entry $id.s_r.paramsymto.entryname -side right + + frame $id.s_r.paramsymfrom + pack $id.s_r.paramsymfrom -side top -anchor e + label $id.s_r.paramsymfrom.entryname -text "receive symbol" + entry $id.s_r.paramsymfrom.entry -textvariable $var_gatomsymfrom -width 21 + pack $id.s_r.paramsymfrom.entry $id.s_r.paramsymfrom.entryname -side right + + frame $id.buttonframe -pady 5 + pack $id.buttonframe -side top -fill x -pady 2m button $id.buttonframe.cancel -text {Cancel}\ -command "dogatom_cancel $id" + pack $id.buttonframe.cancel -side left -expand 1 button $id.buttonframe.apply -text {Apply}\ -command "dogatom_apply $id" + pack $id.buttonframe.apply -side left -expand 1 button $id.buttonframe.ok -text {OK}\ -command "dogatom_ok $id" - pack $id.buttonframe.cancel -side left -expand 1 - pack $id.buttonframe.apply -side left -expand 1 pack $id.buttonframe.ok -side left -expand 1 - frame $id.paramsymto - pack $id.paramsymto -side bottom - label $id.paramsymto.entryname -text {send symbol} - entry $id.paramsymto.entry -textvariable $var_gatomsymto -width 20 - pack $id.paramsymto.entryname $id.paramsymto.entry -side left - - frame $id.paramsymfrom - pack $id.paramsymfrom -side bottom - label $id.paramsymfrom.entryname -text {receive symbol} - entry $id.paramsymfrom.entry -textvariable $var_gatomsymfrom -width 20 - pack $id.paramsymfrom.entryname $id.paramsymfrom.entry -side left - - frame $id.radio - pack $id.radio -side bottom - label $id.radio.label -text {show label on:} - frame $id.radio.l - frame $id.radio.r - pack $id.radio.label -side top - pack $id.radio.l $id.radio.r -side left - radiobutton $id.radio.l.radio0 -value 0 \ - -variable $var_gatomwherelabel \ - -text "left" - radiobutton $id.radio.l.radio1 -value 1 \ - -variable $var_gatomwherelabel \ - -text "right" - radiobutton $id.radio.r.radio2 -value 2 \ - -variable $var_gatomwherelabel \ - -text "top" - radiobutton $id.radio.r.radio3 -value 3 \ - -variable $var_gatomwherelabel \ - -text "bottom" - pack $id.radio.l.radio0 $id.radio.l.radio1 -side top -anchor w - pack $id.radio.r.radio2 $id.radio.r.radio3 -side top -anchor w - - - frame $id.paramlabel - pack $id.paramlabel -side bottom - label $id.paramlabel.entryname -text label - entry $id.paramlabel.entry -textvariable $var_gatomlabel -width 20 - pack $id.paramlabel.entryname $id.paramlabel.entry -side left - - frame $id.paramhi - pack $id.paramhi -side bottom - label $id.paramhi.entryname -text "upper limit" - entry $id.paramhi.entry -textvariable $var_gatomhi -width 8 - pack $id.paramhi.entryname $id.paramhi.entry -side left - - frame $id.paramlo - pack $id.paramlo -side bottom - label $id.paramlo.entryname -text "lower limit" - entry $id.paramlo.entry -textvariable $var_gatomlo -width 8 - pack $id.paramlo.entryname $id.paramlo.entry -side left - - frame $id.params - pack $id.params -side bottom - label $id.params.entryname -text width - entry $id.params.entry -textvariable $var_gatomwidth -width 4 - pack $id.params.entryname $id.params.entry -side left - - - - bind $id.paramhi.entry [concat dogatom_ok $id] - bind $id.paramlo.entry [concat dogatom_ok $id] + bind $id.limits.upper.entry [concat dogatom_ok $id] + bind $id.limits.lower.entry [concat dogatom_ok $id] bind $id.params.entry [concat dogatom_ok $id] - pdtk_standardkeybindings $id.paramhi.entry - pdtk_standardkeybindings $id.paramlo.entry + pdtk_standardkeybindings $id.limits.upper.entry + pdtk_standardkeybindings $id.limits.lower.entry pdtk_standardkeybindings $id.params.entry $id.params.entry select from 0 $id.params.entry select adjust end @@ -2132,7 +2188,7 @@ proc iemgui_clip_fontsize {id} { if {[eval concat $$var_iemgui_gn_fs] < $iemgui_define_min_fontsize} { set $var_iemgui_gn_fs $iemgui_define_min_fontsize - $id.gnfs.fs_ent configure -textvariable $var_iemgui_gn_fs + $id.label.fs_ent configure -textvariable $var_iemgui_gn_fs } } @@ -2146,20 +2202,20 @@ proc iemgui_set_col_example {id} { set var_iemgui_lcol [concat iemgui_lcol_$vid] global $var_iemgui_lcol - $id.col_example_choose.lb_bk configure \ + $id.colors.sections.lb_bk configure \ -background [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \ -activebackground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \ -foreground [format "#%6.6x" [eval concat $$var_iemgui_lcol]] \ -activeforeground [format "#%6.6x" [eval concat $$var_iemgui_lcol]] if { [eval concat $$var_iemgui_fcol] >= 0 } { - $id.col_example_choose.fr_bk configure \ + $id.colors.sections.fr_bk configure \ -background [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \ -activebackground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \ -foreground [format "#%6.6x" [eval concat $$var_iemgui_fcol]] \ -activeforeground [format "#%6.6x" [eval concat $$var_iemgui_fcol]] } else { - $id.col_example_choose.fr_bk configure \ + $id.colors.sections.fr_bk configure \ -background [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \ -activebackground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \ -foreground [format "#%6.6x" [eval concat $$var_iemgui_bcol]] \ @@ -2243,17 +2299,27 @@ proc iemgui_lilo {id} { } } -proc iemgui_toggle_font {id} { +proc iemgui_toggle_font {id gn_f} { set vid [string trimleft $id .] set var_iemgui_gn_f [concat iemgui_gn_f_$vid] global $var_iemgui_gn_f + global fontname fontweight - set $var_iemgui_gn_f [expr [eval concat $$var_iemgui_gn_f] + 1] - if {[eval concat $$var_iemgui_gn_f] > 2} {set $var_iemgui_gn_f 0} - if {[eval concat $$var_iemgui_gn_f] == 0} {$id.gnfs.fb configure -text "courier" -font {courier 10 bold}} - if {[eval concat $$var_iemgui_gn_f] == 1} {$id.gnfs.fb configure -text "helvetica" -font {helvetica 10 bold}} - if {[eval concat $$var_iemgui_gn_f] == 2} {$id.gnfs.fb configure -text "times" -font {times 10 bold}} + set $var_iemgui_gn_f $gn_f + + switch -- $gn_f { + 0 { set current_font $fontname} + 1 { set current_font "Helvetica" } + 2 { set current_font "Times" } + } + set current_font_spec "{$current_font} 12 $fontweight" + + $id.label.fontpopup_label configure -text $current_font \ + -font $current_font_spec + $id.label.name_entry configure -font $current_font_spec + $id.colors.sections.fr_bk configure -font $current_font_spec + $id.colors.sections.lb_bk configure -font $current_font_spec } proc iemgui_lb {id} { @@ -2399,6 +2465,9 @@ proc pdtk_iemgui_dialog {id mainheader \ set vid [string trimleft $id .] + global pd_nt + global fontname fontweight + set var_iemgui_wdt [concat iemgui_wdt_$vid] global $var_iemgui_wdt set var_iemgui_min_wdt [concat iemgui_min_wdt_$vid] @@ -2486,7 +2555,8 @@ proc pdtk_iemgui_dialog {id mainheader \ set $var_iemgui_l2_f1_b0 0 toplevel $id - wm title $id [format "%s-PROPERTIES" $mainheader] + wm title $id [format "%s Properties" $mainheader] + wm resizable $id 0 0 wm protocol $id WM_DELETE_WINDOW [concat iemgui_cancel $id] frame $id.dim @@ -2519,7 +2589,7 @@ proc pdtk_iemgui_dialog {id mainheader \ $id.rng.max_lab $id.rng.max_ent -side left} } if { [eval concat $$var_iemgui_lin0_log1] >= 0 || [eval concat $$var_iemgui_loadbang] >= 0 || [eval concat $$var_iemgui_num] > 0 || [eval concat $$var_iemgui_steady] >= 0 } { - label $id.space1 -text "---------------------------------" + label $id.space1 -text "" pack $id.space1 -side top } frame $id.para @@ -2548,157 +2618,189 @@ proc pdtk_iemgui_dialog {id mainheader \ pack $id.para.dummy3 $id.para.num_lab $id.para.num_ent -side left -expand 1} if {[eval concat $$var_iemgui_steady] >= 0} { pack $id.para.dummy3 $id.para.stdy_jmp -side left -expand 1} - if { $snd != "nosndno" || $rcv != "norcvno" } { - label $id.space2 -text "---------------------------------" - pack $id.space2 -side top } + + frame $id.spacer0 -height 4 + pack $id.spacer0 -side top - frame $id.snd - pack $id.snd -side top - label $id.snd.dummy1 -text "" -width 2 - label $id.snd.lab -text "send-symbol:" -width 12 - entry $id.snd.ent -textvariable $var_iemgui_snd -width 20 + labelframe $id.s_r -borderwidth 1 -pady 4 -text "messages" \ + -font highlight_font + pack $id.s_r -side top -fill x -ipadx 5 + frame $id.s_r.send + pack $id.s_r.send -side top + label $id.s_r.send.lab -text " send-symbol:" -width 12 -justify right + entry $id.s_r.send.ent -textvariable $var_iemgui_snd -width 22 if { $snd != "nosndno" } { - pack $id.snd.dummy1 $id.snd.lab $id.snd.ent -side left} + pack $id.s_r.send.lab $id.s_r.send.ent -side left} - frame $id.rcv - pack $id.rcv -side top - label $id.rcv.lab -text "receive-symbol:" -width 15 - entry $id.rcv.ent -textvariable $var_iemgui_rcv -width 20 + frame $id.s_r.receive + pack $id.s_r.receive -side top + label $id.s_r.receive.lab -text "receive-symbol:" -width 12 -justify right + entry $id.s_r.receive.ent -textvariable $var_iemgui_rcv -width 22 if { $rcv != "norcvno" } { - pack $id.rcv.lab $id.rcv.ent -side left} + pack $id.s_r.receive.lab $id.s_r.receive.ent -side left} - frame $id.gnam - pack $id.gnam -side top - label $id.gnam.head -text "--------------label:---------------" - label $id.gnam.dummy1 -text "" -width 1 - label $id.gnam.lab -text "name:" -width 6 - entry $id.gnam.ent -textvariable $var_iemgui_gui_nam -width 29 - label $id.gnam.dummy2 -text "" -width 1 - pack $id.gnam.head -side top - pack $id.gnam.dummy1 $id.gnam.lab $id.gnam.ent $id.gnam.dummy2 -side left +# get the current font name from the int given from C-space (gn_f) + set current_font $fontname + if {[eval concat $$var_iemgui_gn_f] == 1} \ + { set current_font "Helvetica" } + if {[eval concat $$var_iemgui_gn_f] == 2} \ + { set current_font "Times" } + + frame $id.spacer1 -height 7 + pack $id.spacer1 -side top - frame $id.gnxy - pack $id.gnxy -side top - label $id.gnxy.x_lab -text "x_off:" -width 6 - entry $id.gnxy.x_ent -textvariable $var_iemgui_gn_dx -width 5 - label $id.gnxy.dummy1 -text " " -width 10 - label $id.gnxy.y_lab -text "y_off:" -width 6 - entry $id.gnxy.y_ent -textvariable $var_iemgui_gn_dy -width 5 - pack $id.gnxy.x_lab $id.gnxy.x_ent $id.gnxy.dummy1 \ - $id.gnxy.y_lab $id.gnxy.y_ent -side left + labelframe $id.label -borderwidth 1 -text "label" -pady 4 \ + -font highlight_font + pack $id.label -side top -fill x + entry $id.label.name_entry -textvariable $var_iemgui_gui_nam -width 30 \ + -font [list $current_font 12 $fontweight] + pack $id.label.name_entry -side top -expand yes -fill both -padx 5 - frame $id.gnfs - pack $id.gnfs -side top - label $id.gnfs.f_lab -text "font:" -width 6 - if {[eval concat $$var_iemgui_gn_f] == 0} { - button $id.gnfs.fb -text "courier" -font {courier 10 bold} -width 7 -command "iemgui_toggle_font $id" } - if {[eval concat $$var_iemgui_gn_f] == 1} { - button $id.gnfs.fb -text "helvetica" -font {helvetica 10 bold} -width 7 -command "iemgui_toggle_font $id" } - if {[eval concat $$var_iemgui_gn_f] == 2} { - button $id.gnfs.fb -text "times" -font {times 10 bold} -width 7 -command "iemgui_toggle_font $id" } - label $id.gnfs.dummy1 -text "" -width 1 - label $id.gnfs.fs_lab -text "fontsize:" -width 8 - entry $id.gnfs.fs_ent -textvariable $var_iemgui_gn_fs -width 5 - pack $id.gnfs.f_lab $id.gnfs.fb $id.gnfs.dummy1 \ - $id.gnfs.fs_lab $id.gnfs.fs_ent -side left + frame $id.label.xy -padx 27 -pady 1 + pack $id.label.xy -side top + label $id.label.xy.x_lab -text "x offset" -width 6 + entry $id.label.xy.x_entry -textvariable $var_iemgui_gn_dx -width 5 + label $id.label.xy.dummy1 -text " " -width 2 + label $id.label.xy.y_lab -text "y offset" -width 6 + entry $id.label.xy.y_entry -textvariable $var_iemgui_gn_dy -width 5 + pack $id.label.xy.x_lab $id.label.xy.x_entry $id.label.xy.dummy1 \ + $id.label.xy.y_lab $id.label.xy.y_entry -side left -anchor e - label $id.col_head -text "--------------colors:--------------" - pack $id.col_head -side top + label $id.label.fontpopup_label -text $current_font \ + -relief groove -font [list $current_font 12 $fontweight] -padx 5 + pack $id.label.fontpopup_label -side left -anchor w -expand yes -fill x + label $id.label.fontsize_label -text "size" -width 4 + entry $id.label.fontsize_entry -textvariable $var_iemgui_gn_fs -width 5 + pack $id.label.fontsize_entry $id.label.fontsize_label \ + -side right -anchor e -padx 5 -pady 5 + menu $id.popup + $id.popup add command \ + -label $fontname \ + -font [format {{%s} 12 %s} $fontname $fontweight] \ + -command "iemgui_toggle_font $id 0" + $id.popup add command \ + -label "Helvetica" \ + -font [format {Helvetica 12 %s} $fontweight] \ + -command "iemgui_toggle_font $id 1" + $id.popup add command \ + -label "Times" \ + -font [format {Times 12 %s} $fontweight] \ + -command "iemgui_toggle_font $id 2" + bind $id.label.fontpopup_label