Forums > Javascript

Bpatcher and rect

Feb 22 2014 | 2:58 pm

Hi there,

I need some help getting both the presentation rectangle and the patching rectangle attributes of a bpatcher. I know this topic has been addressed already here over and over again, but it didn’t work for me.

If I have a bpatcher called "bpatcher", then in js:
bpatcher = this.patcher.getnamed("bpatcher");
bpatcher.getattr("presentation_rect"); //is null
bpatcher.getattr("rect") //is set, seems absolute on screen.
bpatcher.rect //is set, seems relative to the current window.

How can I get both the presentation and the patching rectangle of a bpatcher?

Thanks for your time,
PS: I was able to set those attributes, via
this.patcher.message("script", "sendbox", p.varname, "presentation_rect",0,0,100,100);

Jan 24 2016 | 11:01 am

in case anyone is still looking: will get you this.

Jan 24 2016 | 12:54 pm

or if you need presentation_rect to change:


Viewing 3 posts - 1 through 3 (of 3 total)

Forums > Javascript