Forums > MaxMSP

Scrollbars not appearing untill patcher unlocked

March 26, 2008 | 4:56 pm

Hi all, I am having a slight problem with my Max patch. I have a load of fairly large units (300x300px) that make up a modular synthesizer. These are created in bpatchers, using a javascript file to control the generation of the units depending on user input.

If a unit is created that goes out of the patcher the scroll bars do not appear until the patcher is unlocked. They are then visible once the patcher is relocked so the user can view and interact with the whole patch.

What I’m looking for is some way to refresh the window so it realizes new content has been added.

Cheers, Dave.


March 26, 2008 | 5:25 pm

On Mar 26, 2008, at 9:56 AM, David Rowland wrote:
> What I’m looking for is some way to refresh the window so it
> realizes new content has been added.

No idea if it will work in this case but there is a "refresh" message
to Max.

Chris Muir
cbm@well.com

http://www.xfade.com


March 26, 2008 | 5:57 pm

Sorry no luck, I tried sending it from a message box and as part of the script. Thanks for the suggestion though.


March 26, 2008 | 7:13 pm

There may be a better way to do this, but if you send a ‘script show
namedobject’ to thispatcher it will update the scrollbars:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 12 38 240 196617 script new var1 toggle 100 600 , script
show var1;
#N thispatcher;
#Q end;
#P newobj 12 68 61 196617 thispatcher;
#P connect 1 0 0 0;
#P window clipboard copycount 2;

I believe js patcher objects can accept any message you can send to a
thispatcher object.

-ben b.

David Rowland wrote:
> Hi all, I am having a slight problem with my Max patch. I have a load of fairly large units (300x300px) that make up a modular synthesizer. These are created in bpatchers, using a javascript file to control the generation of the units depending on user input.
>
> If a unit is created that goes out of the patcher the scroll bars do not appear until the patcher is unlocked. They are then visible once the patcher is relocked so the user can view and interact with the whole patch.
>
> What I’m looking for is some way to refresh the window so it realizes new content has been added.
>


March 27, 2008 | 3:28 am

Cheers, this certainly works when I send the message to a ‘thispatcher’ object but could someone help me with the js syntax.

Currently I am using show as a property of ‘jsthis’ so I thought it would be: patcher.show.OSCUnit[noOSCUnits-1].varname;
where OSCUnit[noOSCUnits-1] is the Maxobj returned form the last last object created.

As I have said javascript is fairly new to me so any help is much appriciated.

Cheers,
Dave.


March 27, 2008 | 10:49 pm

yea, I’m not having any luck with ‘show’ in js either.

one way of doing it is to get the rect of the newly created object and
then use that array to describe to the wind what you want its size to
be, using the size property.

there might be an easier way. i’d recommend taking this over to the
javascript forums if you still are having problems.

-b

David Rowland wrote:
> Cheers, this certainly works when I send the message to a ‘thispatcher’ object but could someone help me with the js syntax.
>
> Currently I am using show as a property of ‘jsthis’ so I thought it would be: patcher.show.OSCUnit[noOSCUnits-1].varname;
> where OSCUnit[noOSCUnits-1] is the Maxobj returned form the last last object created.
>
> As I have said javascript is fairly new to me so any help is much appriciated.
>


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