hi list,
i finally got hacked a feature that i allways wanted: automatic scrollbars :)
like, if the patch window is wider than the actual patch, dont show the horizontal scrollbar, same for vertical. and of course show the scrollbar(s) again, if patch bigger than window size...
i just started learning tcl/tk ~3 days ago, so this code may have faults&co...
here we go (edit pd.tk)
add this: bind $name.c <Configure> { pdtk_canvas_scrollbars %W %w %h } :some where (i have it by the other "bindings")
and add this: proc pdtk_canvas_scrollbars {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} } :some where (i have it by the other "event bindings procedures")
thats it.
i dont know how i could use something like pd object [change] in those pack if's... if needed ?
and having to use the same settings (-side, -fill) again doesnt sound good neither....
well, atleast it seems to work :)
sleepy, -andre
ps. sorry for line breaks, cant find the setting in my email client :/
i had/heard problems with sf.net cvs, so i used millers pd (0.39.2) from his site...
but yes, i gotta learn to use diff tools, any tips ;) ?
-andre
On Thu, 2006-04-27 at 08:30 +0000, Georg Holzmann wrote:
Hallo!
i finally got hacked a feature that i allways wanted: automatic scrollbars :)
nice feature !
Could you also make a patch against millers pd at sourceforge so that he can integrate your work ;) ?
Thanks, LG Georg
you will want to use diff -uw format. -w means ignore whitespace changes, and -u is a format that provides context information so that the patch program can apply the patches with more sense that just using line numbers.
Something like this:
diff -uw pd/src/u_main.tk path/to/my/u_main.tk > scrollbar- fix-0.39.2.patch
.hc
On Apr 27, 2006, at 12:27 PM, Andre Schmidt wrote:
i had/heard problems with sf.net cvs, so i used millers pd (0.39.2) from his site...
but yes, i gotta learn to use diff tools, any tips ;) ?
-andre
On Thu, 2006-04-27 at 08:30 +0000, Georg Holzmann wrote:
Hallo!
i finally got hacked a feature that i allways wanted: automatic scrollbars :)
nice feature !
Could you also make a patch against millers pd at sourceforge so that he can integrate your work ;) ?
Thanks, LG Georg
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
________________________________________________________________________ ____
"Computer science is no more related to the computer than astronomy is related to the telescope." -Edsger Dykstra