diff options
Diffstat (limited to 'pd/src')
-rw-r--r-- | pd/src/m_sched.c | 2 | ||||
-rw-r--r-- | pd/src/s_audio.c | 2 | ||||
-rw-r--r-- | pd/src/u_main.tk | 124 |
3 files changed, 64 insertions, 64 deletions
diff --git a/pd/src/m_sched.c b/pd/src/m_sched.c index b21e6e79..035c0b27 100644 --- a/pd/src/m_sched.c +++ b/pd/src/m_sched.c @@ -534,7 +534,7 @@ static void m_callbackscheduler(void) #ifdef MSW Sleep(1000); #else - sleep(1); + sleep(1); #endif if (sys_idlehook) sys_idlehook(); diff --git a/pd/src/s_audio.c b/pd/src/s_audio.c index 010d14ea..b00c0dd6 100644 --- a/pd/src/s_audio.c +++ b/pd/src/s_audio.c @@ -731,7 +731,7 @@ void glob_audio_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) } if (newcallback < 0) - newcallback = 0; + newcallback = 0; if (audio_callback == newcallback) sys_close_audio(); sys_set_audio_settings(nindev, newaudioindev, nindev, newaudioinchan, diff --git a/pd/src/u_main.tk b/pd/src/u_main.tk index 2a736ca5..be87b8f5 100644 --- a/pd/src/u_main.tk +++ b/pd/src/u_main.tk @@ -417,72 +417,72 @@ proc menu_doc_open {subdir basename} { ################## help browser and support functions ######################### proc menu_doc_browser {dir} { - global .mbar - if {![file isdirectory $dir]} { - puts stderr "menu_doc_browser non-directory $dir\n" - } - if { [winfo exists .help_browser.frame] } { - raise .help_browser - } else { - toplevel .help_browser -menu .mbar - wm title .help_browser "Pd Documentation Browser" - frame .help_browser.frame - pack .help_browser.frame -side top -fill both - doc_make_listbox .help_browser.frame $dir 0 + global .mbar + if {![file isdirectory $dir]} { + puts stderr "menu_doc_browser non-directory $dir\n" + } + if { [winfo exists .help_browser.frame] } { + raise .help_browser + } else { + toplevel .help_browser -menu .mbar + wm title .help_browser "Pd Documentation Browser" + frame .help_browser.frame + pack .help_browser.frame -side top -fill both + doc_make_listbox .help_browser.frame $dir 0 } } proc doc_make_listbox {base dir count} { - # check for [file readable]? - #if { [info tclversion] >= 8.5 } { - # requires Tcl 8.5 but probably deals with special chars better -# destroy {expand}[lrange [winfo children $base] [expr {2 * $count}] end] - #} else { - if { [catch { eval destroy [lrange [winfo children $base] \ - [expr { 2 * $count }] end] } \ - errorMessage] } { - puts stderr "doc_make_listbox: error listing $dir\n" - } - #} - # exportselection 0 looks good, but selection gets easily out-of-sync - set current_listbox [listbox "[set b "$base.listbox$count"]-list" -yscrollcommand \ - [list "$b-scroll" set] -height 20 -exportselection 0] - pack $current_listbox [scrollbar "$b-scroll" -command [list $current_listbox yview]] \ - -side left -expand 1 -fill y -anchor w - foreach item [concat [lsort -dictionary [glob -directory $dir -nocomplain -types {d} -- *]] \ - [lsort -dictionary [glob -directory $dir -nocomplain -types {f} -- *]]] { - $current_listbox insert end "[file tail $item][expr {[file isdirectory $item] ? {/} : {}}]" - } - bind $current_listbox <Button-1> [list doc_navigate $dir $count %W %x %y] - bind $current_listbox <Double-Button-1> [list doc_double_button $dir $count %W %x %y] + # check for [file readable]? + #if { [info tclversion] >= 8.5 } { + # requires Tcl 8.5 but probably deals with special chars better +# destroy {expand}[lrange [winfo children $base] [expr {2 * $count}] end] + #} else { + if { [catch { eval destroy [lrange [winfo children $base] \ + [expr { 2 * $count }] end] } \ + errorMessage] } { + puts stderr "doc_make_listbox: error listing $dir\n" + } + #} + # exportselection 0 looks good, but selection gets easily out-of-sync + set current_listbox [listbox "[set b "$base.listbox$count"]-list" -yscrollcommand \ + [list "$b-scroll" set] -height 20 -exportselection 0] + pack $current_listbox [scrollbar "$b-scroll" -command [list $current_listbox yview]] \ + -side left -expand 1 -fill y -anchor w + foreach item [concat [lsort -dictionary [glob -directory $dir -nocomplain -types {d} -- *]] \ + [lsort -dictionary [glob -directory $dir -nocomplain -types {f} -- *]]] { + $current_listbox insert end "[file tail $item][expr {[file isdirectory $item] ? {/} : {}}]" + } + bind $current_listbox <Button-1> [list doc_navigate $dir $count %W %x %y] + bind $current_listbox <Double-Button-1> [list doc_double_button $dir $count %W %x %y] } proc doc_navigate {dir count width x y} { - if {[set newdir [$width get [$width index "@$x,$y"]]] eq {}} { - return - } - set dir_to_open [file join $dir $newdir] - if {[file isdirectory $dir_to_open]} { - doc_make_listbox [winfo parent $width] $dir_to_open [incr count] - } + if {[set newdir [$width get [$width index "@$x,$y"]]] eq {}} { + return + } + set dir_to_open [file join $dir $newdir] + if {[file isdirectory $dir_to_open]} { + doc_make_listbox [winfo parent $width] $dir_to_open [incr count] + } } proc doc_double_button {dir count width x y} { - global pd_guidir - if {[set newdir [$width get [$width index "@$x,$y"]]] eq {}} { - return - } - set dir_to_open [file join $dir $newdir] - if {[file isdirectory $dir_to_open]} { - doc_navigate $dir $count $width $x $y - } else { - regsub -- $pd_guidir [file dirname $dir_to_open] "" subdir - set file [file tail $dir_to_open] - if { [catch {menu_doc_open $subdir $file} fid] } { - puts stderr "Could not open $pd_guidir/$subdir/$file\n" - } - return; - } + global pd_guidir + if {[set newdir [$width get [$width index "@$x,$y"]]] eq {}} { + return + } + set dir_to_open [file join $dir $newdir] + if {[file isdirectory $dir_to_open]} { + doc_navigate $dir $count $width $x $y + } else { + regsub -- $pd_guidir [file dirname $dir_to_open] "" subdir + set file [file tail $dir_to_open] + if { [catch {menu_doc_open $subdir $file} fid] } { + puts stderr "Could not open $pd_guidir/$subdir/$file\n" + } + return; + } } ############# routine to add media, help, and apple menu items ############### @@ -3281,17 +3281,17 @@ proc pdtk_pd_startup {version apilist midiapilist fontname} { set width0 [font measure $font x] set height0 [lindex [font metrics $font] 5] set fontlist [concat $fontlist $i [font measure $font x] \ - [lindex [font metrics $font] 5]] + [lindex [font metrics $font] 5]] } set tclpatch [info patchlevel] if {$tclpatch == "8.3.0" || \ - $tclpatch == "8.3.1" || \ - $tclpatch == "8.3.2" || \ - $tclpatch == "8.3.3" } { - set oldtclversion 1 + $tclpatch == "8.3.1" || \ + $tclpatch == "8.3.2" || \ + $tclpatch == "8.3.3" } { + set oldtclversion 1 } else { - set oldtclversion 0 + set oldtclversion 0 } pd [concat pd init [pdtk_enquote [pwd]] $oldtclversion $fontlist \;]; |