[PD-cvs] packages/patches pd_autoscrollbars-0.40-pre.patch, NONE, 1.1 pd_controls-anchor-fix-0.40-pre.patch, NONE, 1.1

Hans-Christoph Steiner eighthave at users.sourceforge.net
Sat Sep 16 19:03:15 CEST 2006


Update of /cvsroot/pure-data/packages/patches
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21810

Added Files:
	pd_autoscrollbars-0.40-pre.patch 
	pd_controls-anchor-fix-0.40-pre.patch 
Log Message:
added two nice, small GUI patches from oskude

--- NEW FILE: pd_controls-anchor-fix-0.40-pre.patch ---
--- u_main.tk	2006-08-15 18:09:57.000000000 +0200
+++ u_main.tk	2006-09-04 09:41:46.000000000 +0200
@@ -140,15 +140,14 @@
 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

--- NEW FILE: pd_autoscrollbars-0.40-pre.patch ---
--- u_main.tk	2006-08-15 18:09:57.000000000 +0200
+++ u_main.tk	2006-09-04 10:12:10.000000000 +0200
@@ -1137,6 +1137,7 @@
 # bother with modifiers there.
 # We don't handle multiple clicks yet.
 
+    bind $name.c <Configure> { pdtk_canvas_autoscrollbars %W %w %h }
     bind $name.c <Button> {pdtk_canvas_click %W %x %y %b 0}
     bind $name.c <Shift-Button> {pdtk_canvas_click %W %x %y %b 1}
     bind $name.c <Control-Shift-Button> {pdtk_canvas_click %W %x %y %b 3}
@@ -1430,6 +1431,19 @@
 #get the name of the toplevel window for a canvas; this is also
 #the name of the canvas object in Pd.
 
+proc pdtk_canvas_autoscrollbars {name x y} {
+    set size [$name bbox all]
+    set x2 [lindex $size 2]
+    set y2 [lindex $size 3]
+    set rootname [winfo parent $name]
+    if {$x > $x2} {pack forget $rootname.scrollhort}
+    if {$y > $y2} {pack forget $rootname.scrollvert}
+    if {$x < $x2} {pack $rootname.scrollhort -side bottom \
+                        -fill x -before $rootname.c}
+    if {$y < $y2} {pack $rootname.scrollvert -side right \
+                        -fill y -before $rootname.c}
+}
+
 proc canvastosym {name} {
     string range $name 0 [expr [string length $name] - 3]
 }





More information about the Pd-cvs mailing list