[PD] openpanel window popup behaviour

Hans-Christoph Steiner hans at at.or.at
Wed Aug 26 17:00:32 CEST 2009


On Aug 26, 2009, at 3:01 AM, CICCOLIX wrote:

> glerm soares ha scritto:
>>
>> Hiya,
>>
>> Is the openpanel popup window for choosing files default behaviour  
>> to appear back from the window you are running your patch? Seems  
>> tha this don't make too much sense and the worse is that some  
>> people get stuck when the window is invisible if the patch is with  
>> window maximized. I have seem this several times...
>>
>> Strange that in ubuntu-gnome with compiz working the default  
>> behaviour is not that because the window is poping up in front of  
>> all patches. That's the more desirable, but seems that's it is  
>> dependent of desktop configs?
>>
>> Is there anyway to assure the openpanel window will popup in front  
>> of the running patch window?
> yes, I did this by modifying the source code of pd.tk, just adding  
> the -parent option to the tk_getOpenFile command.
> The proc "pdtk_openpanel" modified look like this:
>
>
> proc pdtk_openpanel {target localdir} {
>   global pd_opendir
>   if {$localdir == ""} {
>     set localdir $pd_opendir
>   }
> ##discover the patch window in front of you
>   set last_patch_window [lindex [split [wm stackorder .] " "] end]
> ##tell tcl to make the opened panel to be cild of the patch in front  
> of you
>   set filename [tk_getOpenFile -parent $last_patch_window - 
> initialdir $localdir]
>   if {$filename != ""} {
>       set directory [string range $filename 0 \
>           [expr [string last / $filename ] - 1]]
>       set pd_opendir $directory
>
>       pd [concat $target callback [pdtk_enquote $filename] \;]
>   }
> }


Does that solve the problem on GNU/Linux?  Miller included something  
like this in 0.42.5 so it would be good to have confirmation that it  
works.

.hc

----------------------------------------------------------------------------

Access to computers should be unlimited and total.  - the hacker ethic






More information about the Pd-list mailing list