how can i change a subpatch attribute from inside the subpatch?

Jul 5, 2010 at 3:06am

how can i change a subpatch attribute from inside the subpatch?

i want to change the background color of a subpatcher, but from inside the patcher, just like i were to send “bgcolor black” message into the left inlet. thanks. just getting into max, so far a gift from god…. be hard to like any other kind of programming now.

#51218
Jul 5, 2010 at 3:10am

well that message doesn’t change bgcolor anyway. what do i have to send some kinda color code? i tried #666666.

#183700
Jul 5, 2010 at 5:22am

look at the file bgcolor.maxhelp

#183701
Jul 5, 2010 at 6:44am

thanks, but i meant the color of the little subpatch object in the main patch.

#183702
Jul 5, 2010 at 11:15am

the actual [p subpatch] object? just use the Inspector. You can also grab and drag any Inspector field onto the object, it’ll connect a message box with the right command ready-to-go. Use a [swatch] to make the colors more intuitive, unless you like specifying colors using RGB values :)

#183703
Jul 7, 2010 at 12:32am

the subpatch has to be able to trigger it’s own color change from within itself. right now, i have an [led] connected to a special output on the subpatch… but i’d like to do away with that garbage and just have the subpatch change color. anybody know if this is possible? thanks.

#183704
Jul 12, 2010 at 5:56am

script sendbox [subpatch scripting name] bgcolor 1. 0. 0. 1.

to [thispatcher]

will set the background color of the subpatch box to red.

you can send any (?) attribute-changing message this way, and hide the messages. the [thispatcher] needs to be on the main level though.

#183705
Jul 12, 2010 at 4:05pm

it’s something like this:

– Pasted Max Patch, click to expand. –
#183706

You must be logged in to reply to this topic.