[PD-dev] rebinding tab and shift-tab in dialog windows

Miller Puckette mpuckett at man104-1.ucsd.edu
Mon Jun 9 03:50:39 CEST 2003


Zowee, it works...

thanks
Miller

On Sat, Jun 07, 2003 at 04:03:39PM +0200, Krzysztof Czaja wrote:
> another variant of the same (the rtt was 30 min, btw...):
> 
> --- ../src/u_main.tk	2002-11-28 06:58:14.000000000 +0100
> +++ pd.tk	2003-06-07 15:31:34.000000000 +0200
> @@ -33,8 +33,11 @@
>   # for Text objects to get control-s and control-t to do what we want for
>   # "text" dialogs below.  Also we have to get rid of tab's changing the focus.
> 
> +namespace eval pdtk {set tab_binding [bind all <Key-Tab>]}
> +namespace eval pdtk {set shifttab_binding [bind all <<PrevWindow>>]}
> +
>   bind all <Key-Tab> ""
> -bind all <Shift-Key-Tab> ""
> +bind all <<PrevWindow>> ""
>   bind Text <Control-t> {}
>   bind Text <Control-s> {}
>   # puts stderr [bind all]
> @@ -234,6 +237,7 @@
> 
>   proc menu_documentation {} {
>       global help_directory
> +    global pd_nt
> 
>       set filename [tk_getOpenFile -defaultextension .pd \
>       -filetypes { {{documentation} {.pd .txt .htm}} } \
> @@ -831,7 +835,7 @@
>       bind $name.c <KeyRelease> {pdtk_canvas_keyup %W %K %A}
>       bind $name.c <Motion> {pdtk_canvas_motion %W %x %y 0}
>       bind $name.c <Alt-Motion> {pdtk_canvas_motion %W %x %y 4}
> -    bind $name.c <Map> {pdtk_canvas_map %W %s}
> +    bind $name.c <Map> {pdtk_canvas_map %W 0}
>   #    bind $name.c <Unmap> {puts stderr map}
>       focus $name.c
>   #    puts stderr "all done"
> @@ -2187,6 +2191,9 @@
>       label $id.space5 -text ""
>       pack $id.space5 -side top
> 
> +    bind $id <Key-Tab> $pdtk::tab_binding
> +    bind $id <<PrevWindow>> $pdtk::shifttab_binding
> +
>       bind $id.dim.w_ent <KeyPress-Return> [concat iemgui_ok $id]
>       bind $id.dim.h_ent <KeyPress-Return> [concat iemgui_ok $id]
> 
> 
> _______________________________________________
> PD-dev mailing list
> PD-dev at iem.kug.ac.at
> http://iem.kug.ac.at/cgi-bin/mailman/listinfo/pd-dev




More information about the Pd-dev mailing list