Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31880
Modified Files: Tag: devel_0_39 desire.tk Log Message: more work on menu stuff
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.133 retrieving revision 1.1.2.134 diff -C2 -d -r1.1.2.133 -r1.1.2.134 *** desire.tk 2 Dec 2005 10:59:45 -0000 1.1.2.133 --- desire.tk 4 Dec 2005 11:59:28 -0000 1.1.2.134 *************** *** 292,306 ****
################## set up main window ######################### - menu .mbar
! pack [frame .controls] -side top -fill x ! foreach t {file find media window help} { ! .mbar add cascade -label [say $t] -menu [menu .mbar.$t -tearoff $pd_tearoff] ! } ! .mbar.window configure -postcommand fixwindowmenu
set ctrls_audio_on 0 set ctrls_meter_on 0
proc pdtk_pd_meters {indb outdb inclip outclip} { foreach {z clip db} [list in $inclip $indb out $outclip $outdb] { --- 292,314 ----
################## set up main window #########################
! #class_new client {menuable view} ! class_new client {menuable}
set ctrls_audio_on 0 set ctrls_meter_on 0
+ def client init_binds {} { + global OS + bind . <Control-Key> {$main ctrlkey %K 0} + bind . <Control-Shift-Key> {$main ctrlkey %K 1} + switch $OS { + osx { + bind . <Mod1-Key> {$main ctrlkey %K 0} + bind . <Mod1-Shift-Key> {$main ctrlkey %K 1} + } + } + } + proc pdtk_pd_meters {indb outdb inclip outclip} { foreach {z clip db} [list in $inclip $indb out $outclip $outdb] { *************** *** 318,322 **** }
! foreach z {in out} { set f .controls.$z frame $f --- 326,338 ---- }
! def client init_controls {} { ! global pd_tearoff OS ! menu .mbar ! pack [frame .controls] -side top -fill x ! foreach t {file find media window help} { ! .mbar add cascade -label [say $t] -menu [menu .mbar.$t -tearoff $pd_tearoff] ! } ! .mbar.window configure -postcommand fixwindowmenu ! foreach z {in out} { set f .controls.$z frame $f *************** *** 328,339 **** pack $f.1.mtr $f.1.clip -side left -pady 2 -padx 0 pack $f.1 -padx 6 -pady 9 ! label $f.2 -text [say $z] ! place $f.2 -x 11 -y -4 pack $f -side left -pady 0 -padx 0 }
proc pdtk_pd_dsp {value} { global ctrls_audio_on ! if {$value == "ON"} {set ctrls_audio_on 1} else {set ctrls_audio_on 0} }
--- 344,367 ---- pack $f.1.mtr $f.1.clip -side left -pady 2 -padx 0 pack $f.1 -padx 6 -pady 9 ! place [label $f.2 -text [say $z]] -x 11 -y -4 pack $f -side left -pady 0 -padx 0 + } + frame .controls.switches + foreach {w x y z} { + audiobutton audio ctrls_audio_on {pd pd dsp $ctrls_audio_on} + meterbutton meters ctrls_meter_on {pd pd meters $ctrls_meter_on} + } { + pack [checkbutton .controls.switches.$w -text [say $x] \ + -variable $y -anchor w -command $z] -side left + } + pack [button .controls.switches.dio -text [say io_errors] -command {pd pd audiostatus}] + pack .controls.switches -side right + . configure -menu .mbar + wm title . "DesireData" }
proc pdtk_pd_dsp {value} { global ctrls_audio_on ! set ctrls_audio_on [expr $value == "ON"] }
*************** *** 343,370 **** }
- frame .controls.switches - foreach {w x y z} { - audiobutton "audio" ctrls_audio_on {pd pd dsp $ctrls_audio_on} - meterbutton "meters" ctrls_meter_on {pd pd meters $ctrls_meter_on} - } { - pack [checkbutton .controls.switches.$w -text $x \ - -variable $y -anchor w -command $z] -side left - } - - pack [button .controls.switches.dio -text "io errors" \ - -command {pd pd audiostatus}] - pack .controls.switches -side right - - bind . <Control-Key> {$main ctrlkey %K 0} - bind . <Control-Shift-Key> {$main ctrlkey %K 1} - switch $OS { - osx { - bind . <Mod1-Key> {$main ctrlkey %K 0} - bind . <Mod1-Shift-Key> {$main ctrlkey %K 1} - } - } - wm title . "DesireData" - . configure -menu .mbar - ############### set up global variables ################################
--- 371,374 ---- *************** *** 442,449 **** }
! set server_sock [socket -server accept_pd 13666]
if {$cmdline(valgrind)} { ! exec valgrind --tool=memcheck pd -guiport 13666 & } { if {$cmdline(gdb)} { --- 446,454 ---- }
! set server_port 13666 ! set server_sock [socket -server accept_pd $server_port]
if {$cmdline(valgrind)} { ! exec valgrind --tool=memcheck pd -guiport $server_port & } { if {$cmdline(gdb)} { *************** *** 452,463 **** fconfigure $gdb -blocking 0 -buffering none puts $gdb "file pd" ! puts $gdb "run -guiport 13666" flush $gdb after 0 poll_gdb } { ! exec gdb --tui --args pd -guiport 13666 & } } { ! exec pd -guiport 13666 & } } --- 457,468 ---- fconfigure $gdb -blocking 0 -buffering none puts $gdb "file pd" ! puts $gdb "run -guiport $server_port" flush $gdb after 0 poll_gdb } { ! exec gdb --tui --args pd -guiport $server_port & } } { ! exec pd -guiport $server_port & } } *************** *** 513,519 **** }
- #class_new client {menuable view} - class_new client {menuable} - set untitled_number 1 set untitled_directory [pwd] --- 518,521 ---- *************** *** 531,534 **** --- 533,538 ----
set main [client_new] + $main init_controls + $main init_binds
def client open_file {} { *************** *** 541,548 ****
def client open_file_really {filename} { ! global pd_opendir _ font ! set directory [string range $filename 0 [expr [string last / $filename] - 1]] set pd_opendir $directory ! set basename [string range $filename [expr [string last / $filename] + 1] end] if {[string last .pd $filename] >= 0} { pd pd open [enquote $basename] [enquote $directory] --- 545,553 ----
def client open_file_really {filename} { ! global pd_opendir font ! set i [string last / $filename] ! set directory [string range $filename 0 [expr $i-1]] set pd_opendir $directory ! set basename [string range $filename [expr $i+1] end] if {[string last .pd $filename] >= 0} { pd pd open [enquote $basename] [enquote $directory] *************** *** 567,571 **** #-----------------------------------------------------------------------------------#
! def menuable populate_menu {menu list} {foreach e $list {$self populate_menu_1 $menu $e}} def menuable populate_menu_1 {menu e} { if {[llength $e]==0} {$menu add separator; return} --- 572,579 ---- #-----------------------------------------------------------------------------------#
! def menuable populate_menu {menu list} { ! if {[string index $menu 0]!="."} {set menu .$self.m.$menu} ! foreach e $list {$self populate_menu_1 $menu $e} ! } def menuable populate_menu_1 {menu e} { if {[llength $e]==0} {$menu add separator; return} *************** *** 591,595 **** #################### the "File" menu for the Pd window ##############
! $main populate_menu .mbar.file { {new_file {} "Ctrl+n"} {open_file {} "Ctrl+o"} --- 599,604 ---- #################### the "File" menu for the Pd window ##############
! def client init_menus {} { ! $self populate_menu .mbar.file { {new_file {} "Ctrl+n"} {open_file {} "Ctrl+o"} *************** *** 599,604 **** {paths {} ""} {} ! {quit {} "Ctrl+q"} ! }
# switch -- $key { --- 608,618 ---- {paths {} ""} {} ! {quit {} "Ctrl+q"}} ! ! $self populate_menu .mbar.find { ! {find {} "Ctrl+f"} ! {find_again {} "Ctrl+g"} ! {find_last_error {} {}}} !
# switch -- $key { *************** *** 606,616 **** # period {$self audio 0} # } - - # note: uplevel would be nice but with the supercalls we don't know how many levels up - def* menuable eval% {code} { - regsub -all %W $code $self code - eval $code - } - # switch -- $key { # Q {$main really_quit} --- 620,623 ---- *************** *** 625,628 **** --- 632,645 ---- # e {$self editmodeswitch} #} + } + + $main init_menus + + # note: uplevel would be nice but with the supercalls we don't know how many levels up + def* menuable eval% {code} { + regsub -all %W $code $self code + eval $code + } +
def* menuable ctrlkey {key shift} { *************** *** 756,762 **** class_new canvas {menuable view}
! #def canvas close {} {pd $name menuclose 0} ! def canvas save {} {$self checkgeometry; pd $name menusave} ! def canvas saveas {} {$self checkgeometry; pd $name menusaveas} def canvas print {} { set filename [tk_getSaveFile -initialfile pd.ps -defaultextension .ps \ --- 773,779 ---- class_new canvas {menuable view}
! #def canvas close {} {pd $self menuclose 0} ! def canvas save {} {$self checkgeometry; pd .$self menusave} ! def canvas saveas {} {$self checkgeometry; pd .$self menusaveas} def canvas print {} { set filename [tk_getSaveFile -initialfile pd.ps -defaultextension .ps \ *************** *** 773,861 **** def client paths {} {pd pd start-path-dialog}
! set canvasmenu(file) { ! {new_file {} "Ctrl+n"} ! {open_file {} "Ctrl+o"} ! {} ! {send_message {} "Ctrl+m"} ! {paths {} ""} ! {} ! {close {} "Ctrl+w"} ! {save {} "Ctrl+s"} ! {save_as {} "Ctrl+S"} ! {print {} "Ctrl+p"} ! {} ! {quit {} "Ctrl+q"} ! } ! ! set canvasmenu(edit) { ! {undo {} "Ctrl+z"} ! {redo {} "Ctrl+Z"} ! {} ! {cut {} "Ctrl+x"} ! {copy {} "Ctrl+c"} ! {paste {} "Ctrl+v"} ! {duplicate {} "Ctrl+d"} ! {select_all {} "Ctrl+a"} ! {} ! {text_editor {} "Ctrl+t"} ! {font_bomb {} {}} ! {tidy_up {} {}} ! {} ! } ! ! set canvasmenu(put) { ! {Object {pd .%W obj %X %Y} "Ctrl+1"} ! {Message {pd .%W msg %X %Y} "Ctrl+2"} ! {Number {pd .%W floatatom %X %Y} "Ctrl+3"} ! {Symbol {pd .%W symbolatom %X %Y} "Ctrl+4"} ! {Comment {pd .%W text %X %Y} "Ctrl+5"} ! {} ! {Bang {pd .%W bng %X %Y} "Alt+b"} ! {Toggle {pd .%W toggle %X %Y} "Alt+t"} ! {Number2 {pd .%W numbox %X %Y} "Alt+n"} ! {Vslider {pd .%W vslider %X %Y} "Alt+v"} ! {Hslider {pd .%W hslider %X %Y} "Alt+h"} ! {Vradio {pd .%W vradio %X %Y} "Alt+d"} ! {Hradio {pd .%W hradio %X %Y} "Alt+i"} ! {VU {pd .%W vumeter %X %Y} "Alt+u"} ! {dropper {pd .%W dropper %X %Y} "Alt+x"} ! {Canvas {pd .%W mycnv %X %Y} "Alt+c"} ! {} ! {Graph {pd .%W graph } {}} ! {Array {pd .%W menuarray} {}} ! } ! ! set canvasmenu(media) { {audio_on {} "Ctrl+/"} {audio_off {} "Ctrl+."} ! {} ! } ! ! switch $OS { ! osx {} ! default { ! lappend canvasmenu(media) {{Audio settings...} {pd pd audio-properties} {}} ! lappend canvasmenu(media) {{MIDI settings...} {pd pd midi-properties} {}} ! } ! } ! ! lappend canvasmenu(media) {} \ ! {"Test Audio and MIDI" {menu_doc_open doc/7.stuff/tools testtone.pd} ""} \ ! {"Load Meter" {menu_doc_open doc/7.stuff/tools load-meter.pd} ""} ! ! proc menu_addstd {mbar} { ! global pd_apilist pd_midiapilist canvasmenu main ! $main populate_menu $mbar.media $canvasmenu(media) ! $main populate_menu $mbar.media {{}} foreach a $pd_apilist { ! $mbar.media add radiobutton -label [lindex $a 0] -variable pd_whichapi -value [lindex $a 1] \ -command {pd pd audio-setapi $pd_whichapi} } ! $main populate_menu $mbar.media {{}} foreach a $pd_midiapilist { ! $mbar.media add radiobutton -label [lindex $a 0] -variable pd_whichmidiapi -value [lindex $a 1] \ -command {pd pd midi-setapi $pd_whichmidiapi} } ! $main populate_menu $mbar.help { {about {} ""} {"Pure Documentation..." {pd menu_documentation} ""} --- 790,821 ---- def client paths {} {pd pd start-path-dialog}
! proc menu_addstd {mbar} { ! global pd_apilist pd_midiapilist main OS ! set m .mbar.media ! $main populate_menu $m { {audio_on {} "Ctrl+/"} {audio_off {} "Ctrl+."} ! {}} ! switch $OS { ! osx {} ! default { ! $main populate_menu $m { ! {{Audio settings...} {pd pd audio-properties} {}} ! {{MIDI settings...} {pd pd midi-properties} {}}} ! } ! } ! $main populate_menu $m {{} ! {test_audio_and_midi {menu_doc_open doc/7.stuff/tools testtone.pd} ""} ! {load_meter {menu_doc_open doc/7.stuff/tools load-meter.pd} ""} {}} foreach a $pd_apilist { ! $m add radiobutton -label [lindex $a 0] -variable pd_whichapi -value [lindex $a 1] \ -command {pd pd audio-setapi $pd_whichapi} } ! $main populate_menu $m {{}} foreach a $pd_midiapilist { ! $m add radiobutton -label [lindex $a 0] -variable pd_whichmidiapi -value [lindex $a 1] \ -command {pd pd midi-setapi $pd_whichmidiapi} } ! $main populate_menu .mbar.help { {about {} ""} {"Pure Documentation..." {pd menu_documentation} ""} *************** *** 867,871 **** set dialog [menu_doc_open doc/1.manual 1.introduction.txt] wm title $dialog "About Pd" ! label $dialog.title -text "About Pure Data" -font {helvetica 24} pack $dialog.title -side top } --- 827,831 ---- set dialog [menu_doc_open doc/1.manual 1.introduction.txt] wm title $dialog "About Pd" ! label $dialog.title -text [about_pd] -font {helvetica 24} pack $dialog.title -side top } *************** *** 887,891 **** -yscrollcommand "$w.1.scroll set" -background white] -side left -fill both -expand 1 pack [scrollbar $w.1.scroll -command "$w.1.text yview"] -side right -fill y ! pack [button $w.2.close -text Close -command "destroy $w"] -side right pack $w.2 -side bottom -fill x -expand 0 pack $w.1 -side bottom -fill both -expand 1 --- 847,851 ---- -yscrollcommand "$w.1.scroll set" -background white] -side left -fill both -expand 1 pack [scrollbar $w.1.scroll -command "$w.1.text yview"] -side right -fill y ! pack [button $w.2.close -text [say close] -command "destroy $w"] -side right pack $w.2 -side bottom -fill x -expand 0 pack $w.1 -side bottom -fill both -expand 1 *************** *** 954,958 **** def* canvas init {{width 400} {height 300} {geometry +0+0} {editable 1}} { super ! global pd_opendir pd_tearoff OS cmdline canvasmenu focus set name .$self set c .$self.c --- 914,918 ---- def* canvas init {{width 400} {height 300} {geometry +0+0} {editable 1}} { super ! global pd_opendir pd_tearoff OS cmdline focus set name .$self set c .$self.c *************** *** 1010,1013 **** --- 970,975 ---- def canvas focus {} {return $@focus}
+ + #-----------------------------------------------------------------------------------#
*************** *** 1020,1023 **** --- 982,987 ---- global OS set c .$self.c + + # mouse buttons $self bind <Button> click %x %y %b 0 $self bind <Shift-Button> click %x %y %b 1 *************** *** 1037,1041 **** --- 1001,1016 ---- } } + switch $OS { unix { + $self bind <Button-4> scroll y -1 + $self bind <Button-5> scroll y +1 + $self bind <Shift-Button-4> scroll x -1 + $self bind <Shift-Button-5> scroll x +1 + } default { + $self bind <MouseWheel> scroll y [expr -abs(%D)/%D] + $self bind <Shift-MouseWheel> scroll x [expr -abs(%D)/%D] + }} $self bind <ButtonRelease> unclick %x %y %b + + # keyboard $self bind <Control-Key> ctrlkey %K 0 $self bind <Control-Shift-Key> ctrlkey %K 1 *************** *** 1056,1070 **** $self bind <Motion> motion %x %y 0 %s $self bind <Alt-Motion> motion %x %y 4 %s # $self bind <Map> map # $self bind <Unmap> unmap - switch $OS { unix { - $self bind <Button-4> scroll y -1 - $self bind <Button-5> scroll y +1 - $self bind <Shift-Button-4> scroll x -1 - $self bind <Shift-Button-5> scroll x +1 - } default { - $self bind <MouseWheel> scroll y [expr -abs(%D)/%D] - $self bind <Shift-MouseWheel> scroll x [expr -abs(%D)/%D] - }} }
--- 1031,1038 ---- $self bind <Motion> motion %x %y 0 %s $self bind <Alt-Motion> motion %x %y 4 %s + + # other (future use) # $self bind <Map> map # $self bind <Unmap> unmap }
*************** *** 1080,1090 **** def canvas new_menubar {editable} { set name .$self ! global pd_opendir pd_tearoff OS cmdline canvasmenu set m $name.m menu $m ! foreach x {file put view find media help} {menu $m.$x -tearoff $pd_tearoff} ! $self populate_menu $m.file $canvasmenu(file) ! menu $m.edit -postcommand "$self fix_edit_menu" -tearoff $pd_tearoff ! $self populate_menu $m.edit $canvasmenu(edit) $m.edit add checkbutton -label [say edit_mode] \ -selectcolor grey85 -command "menu_editmode $name" \ --- 1048,1113 ---- def canvas new_menubar {editable} { set name .$self ! global pd_opendir pd_tearoff OS cmdline set m $name.m menu $m ! foreach x {file edit view put window help} {menu $m.$x -tearoff $pd_tearoff} ! $self populate_menu file { ! {new_file {} "Ctrl+n"} ! {open_file {} "Ctrl+o"} ! {} ! {send_message {} "Ctrl+m"} ! {paths {} ""} ! {} ! {close {} "Ctrl+w"} ! {save {} "Ctrl+s"} ! {save_as {} "Ctrl+S"} ! {print {} "Ctrl+p"} ! {} ! {quit {} "Ctrl+q"}} ! $self populate_menu edit { ! {undo {} "Ctrl+z"} ! {redo {} "Ctrl+Z"} ! {} ! {cut {} "Ctrl+x"} ! {copy {} "Ctrl+c"} ! {paste {} "Ctrl+v"} ! {duplicate {} "Ctrl+d"} ! {select_all {} "Ctrl+a"} ! {} ! {text_editor {} "Ctrl+t"} ! {font_bomb {} {}} ! {tidy_up {} {}} ! {}} ! $self populate_menu view { ! {reload {} {}} ! {redraw {} {}}} ! # {crosshair {global crosshair; set crosshair [expr !!$crosshair]} "" toggle} ! ! $self populate_menu put { ! {Object {pd .%W obj %X %Y} "Ctrl+1"} ! {Message {pd .%W msg %X %Y} "Ctrl+2"} ! {Number {pd .%W floatatom %X %Y} "Ctrl+3"} ! {Symbol {pd .%W symbolatom %X %Y} "Ctrl+4"} ! {Comment {pd .%W text %X %Y} "Ctrl+5"} ! {} ! {Bang {pd .%W bng %X %Y} "Alt+b"} ! {Toggle {pd .%W toggle %X %Y} "Alt+t"} ! {Number2 {pd .%W numbox %X %Y} "Alt+n"} ! {Vslider {pd .%W vslider %X %Y} "Alt+v"} ! {Hslider {pd .%W hslider %X %Y} "Alt+h"} ! {Vradio {pd .%W vradio %X %Y} "Alt+d"} ! {Hradio {pd .%W hradio %X %Y} "Alt+i"} ! {VU {pd .%W vumeter %X %Y} "Alt+u"} ! {dropper {pd .%W dropper %X %Y} "Alt+x"} ! {Canvas {pd .%W mycnv %X %Y} "Alt+c"} ! {} ! {Graph {pd .%W graph } {}} ! {Array {pd .%W menuarray} {}}} ! $self populate_menu window { ! {"parent window" {menu_windowparent} {}} ! {"Pd window" {menu_pop_pd} {}} ! {} ! } ! $m.edit add checkbutton -label [say edit_mode] \ -selectcolor grey85 -command "menu_editmode $name" \ *************** *** 1093,1115 **** # it's not -indicatoron for checking a box. it should be always on.
! $self populate_menu $m.view { ! {reload {} {}} ! {redraw {} {}}} ! # {crosshair {global crosshair; set crosshair [expr !!$crosshair]} "" toggle}
! $self populate_menu $m.put $canvasmenu(put) ! $self populate_menu $name.m.find { ! {find {} "Ctrl+f"} ! {find_again {} "Ctrl+g"} ! {find_last_error {} {}} ! } ! menu $m.windows -postcommand "foo menu_fixwindowmenu" -tearoff $pd_tearoff ! $self populate_menu $name.m.windows { ! {"parent window" {foo menu_windowparent} {}} ! {"Pd window" {foo menu_pop_pd} {}} ! {} } - foreach x {file edit view find put media window help} {$m add cascade -label [say $x] -menu $m.$x} - menu_addstd $m }
--- 1116,1129 ---- # it's not -indicatoron for checking a box. it should be always on.
! $m.edit configure -postcommand "$self fix_edit_menu" ! $m.window configure -postcommand "menu_fixwindowmenu"
! foreach x {file edit view find put media window help} { ! if {$x=="find" || $x=="media"} { ! $m add cascade -label [say $x] -menu .mbar.$x ! } { ! $m add cascade -label [say $x] -menu $m.$x ! } } }
*************** *** 1132,1136 **** set t [say undo] if {[llength $@undo]} { ! $e entryconfigure $t -state normal -label "$t $@undoaction" } else { $e entryconfigure $t -state disabled -label "[say cannot] $t" --- 1146,1150 ---- set t [say undo] if {[llength $@undo]} { ! $e entryconfigure $t -state normal -label "$t [$@history undoaction]" } else { $e entryconfigure $t -state disabled -label "[say cannot] $t" *************** *** 1138,1142 **** set t [say redo] if {[llength $@redo]} { ! $e entryconfigure $t -state normal -label "$t $@redoaction" } else { $e entryconfigure $t -state disabled -label "[say cannot] $t" --- 1152,1156 ---- set t [say redo] if {[llength $@redo]} { ! $e entryconfigure $t -state normal -label "$t [$@history redoaction]" } else { $e entryconfigure $t -state disabled -label "[say cannot] $t" *************** *** 1750,1757 **** set size [$c bbox all] if {$size != ""} { ! set xmin 0; set xmax 100 ! set ymin 0; set ymax 100 ! set x1 [lindex $size 0]; set x2 [lindex $size 2] ! set y1 [lindex $size 1]; set y2 [lindex $size 3] if {$x1 < 0} {set xmin $x1}; if {$x2 > 100} {set xmax $x2} if {$y1 < 0} {set ymin $y1}; if {$y2 > 100} {set ymax $y2} --- 1764,1769 ---- set size [$c bbox all] if {$size != ""} { ! mset {xmin ymin xmax ymax} {0 0 100 100} ! mset {x1 y1 x2 y2} $size if {$x1 < 0} {set xmin $x1}; if {$x2 > 100} {set xmax $x2} if {$y1 < 0} {set ymin $y1}; if {$y2 > 100} {set ymax $y2} *************** *** 2015,2021 **** set g [expr round((($c>> 6)&63)*255/63)] set b [expr round((($c>> 0)&63)*255/63)] ! set foo [format #%02x%02x%02x $r $g $b] ! #puts $foo ! return $foo } { global preset_colors2 --- 2027,2031 ---- set g [expr round((($c>> 6)&63)*255/63)] set b [expr round((($c>> 0)&63)*255/63)] ! return [format #%02x%02x%02x $r $g $b] } { global preset_colors2 *************** *** 2029,2035 **** set g [expr round((($c>> 8)&255)*63/255)] set b [expr round((($c>> 0)&255)*63/255)] ! set foo [expr ~0[format %02o%02o%02o $r $g $b]] ! #puts "$r $g $b $foo" ! return $foo }
--- 2039,2043 ---- set g [expr round((($c>> 8)&255)*63/255)] set b [expr round((($c>> 0)&255)*63/255)] ! return [expr ~0[format %02o%02o%02o $r $g $b]] }
*************** *** 2982,2986 **** } } ! .browser.title configure -text "$n/[llength $class_list] registered object classes" $f.1 selection set 0 0 } --- 2990,2994 ---- } } ! .browser.title configure -text [format [say "%d of %d object classes"] $n [llength $class_list]] $f.1 selection set 0 0 } *************** *** 3010,3014 ****
frame $f.5 ! button $f.5.help -text "Help" -command {pd pd help [$f.1 get [$f.1 curselection]]} pack $f.5.help -side top pack $f.5 -side left -fill y -expand no --- 3018,3022 ----
frame $f.5 ! button $f.5.help -text [say help] -command {pd pd help [$f.1 get [$f.1 curselection]]} pack $f.5.help -side top pack $f.5 -side left -fill y -expand no *************** *** 3020,3026 **** set b .browser.butt frame $b ! pack [label $b.1 -text "Filter: "] -side left pack [entry $b.2 -width 15] -side left ! pack [button $b.close -text "Close" -command "destroy .browser"] -side right pack $b -side bottom -fill x -expand no class_list_fill_box "" --- 3028,3034 ---- set b .browser.butt frame $b ! pack [label $b.1 -text "[say filter]: "] -side left pack [entry $b.2 -width 15] -side left ! pack [button $b.close -text [say close] -command "destroy .browser"] -side right pack $b -side bottom -fill x -expand no class_list_fill_box ""