[PD] 'relocate' message

Hans-Christoph Steiner hans at at.or.at
Tue Jan 5 00:26:07 CET 2010


On Jan 4, 2010, at 1:50 AM, Hans-Christoph Steiner wrote:

>
> On Jan 3, 2010, at 1:14 AM, Hans-Christoph Steiner wrote:
>
>>
>> On Jan 2, 2010, at 8:22 PM, Jonathan Wilkes wrote:
>>
>>>
>>>
>>> --- On Sun, 1/3/10, Hans-Christoph Steiner <hans at at.or.at> wrote:
>>>
>>>> From: Hans-Christoph Steiner <hans at at.or.at>
>>>> Subject: [PD] 'relocate' message
>>>> To: "Pd List" <pd-list at iem.at>
>>>> Date: Sunday, January 3, 2010, 12:00 AM
>>>>
>>>> Is anyone using the 'relocate' message to move/resize
>>>> windows in Pd?  I ask because I want to simplify that
>>>> code and the message itself in pd-gui-rewrite 0.43.
>>>> Its currently a very strange format, and it no longer needs
>>>> to be.
>>>>
>>>> Here's the only working example that I know of:
>>>> http://pure-data.svn.sourceforge.net/viewvc/pure-data/trunk/doc/additional/pd-msg/1.msg_and_patch/6.relocate_windows..pd?view=log
>>>>
>>>> The idea is to make the message like this:
>>>>
>>>> "relocate   WIDTHxHEIGHT+XLoc+YLoc"
>>>>
>>>> Currently its like this:
>>>>
>>>> "relocate   WIDTHxHEIGHT+0+0
>>>> 0x0+XLoc+YLoc"
>>>>
>>>> .hc
>>>
>>> Hi Hans,
>>>  Is there a reason the message can't simply be "relocate WIDTH  
>>> HEIGHT
>>> XLoc Yloc"?  Whether using pd-ext or vanilla, I've always thought  
>>> it seems
>>> really awkward to cram the coordinates into one big symbol.
>>>
>>> -Jonathan
>>
>>
>> Hmm, that makes sense. I wonder if this should just have the same  
>> syntax as 'canvas', so:
>>
>> relocate x1 y1 x2 y2
>>
>> Where x is the upper left corner, and y is the lower right corner.
>
>
> So I restored the old relocate message, and added a new message  
> which the GUI now uses a new message 'whxy'.  'whxy' stands for  
> Width/Height/X/Y.  Width/Height is the size of the window, and (x,y)  
> is where the upper-left corner is located:
>
> whxy width height xPosition yPosition
> whxy 450 300 0 22
>
> I am now thinking that perhaps I should make it called 'setbounds'  
> after the old internal function, and make it mirror that:
>
>    canvas_setbounds(x, xpos, ypos, xpos + width, ypos + height);
>
> i.e. "setbounds Xleft Ytop Xright Ybottom"

After a little discussion with Miller, this one seems to make the most  
sense, so this is what the pd-gui-rewrite uses now.

http://pure-data.svn.sourceforge.net/viewvc/pure-data?view=rev&revision=12883

.hc


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

If you are not part of the solution, you are part of the problem.






More information about the Pd-list mailing list