Forums > MaxMSP

Transparent text/message box?

May 3, 2007 | 11:39 pm

Is there anyway to get a transparent message box or at least make it black with white text?

In context I’ve created a synth with a GUI that looks nothing like MaxMSP and subsequently the grey boxes of Max look odd and, well, a bit crap when they’re overlaid on the GUI. Anyway, the message box shows updated file name information about a selected sound file (using ‘prepend set’ command). Hopefully someone will be able to help! :)


May 4, 2007 | 1:23 am

go to options menu, select Colors…

set one of the colors to black

go back to your message box, right click (or ctrl-click), select the Color submenu, select the black box.

lock the patch

voila, you have a message box with black background and white text.

the only drawback is that I think this will only work on your computer. if you tried to send this patch to someone, the message box would probably show up with the standard color that was originally in the box that you changed to black.

i think there may be a super top secret way to change people’s default colors using a scripting message to the max object or something… although i don’t think most people would appreciate you messing with their colors…

you could make a pretty simple jsui object that displays the text you input to it, and you can make the text and the background whatever color you want…

-scott


May 4, 2007 | 2:31 am

> Is there anyway to get a transparent message box or at least make it black with white text?

umenu in label mode. Use the Inspector to set this mode, color etc.


May 4, 2007 | 9:11 am

Thanks for your help guys! I tried both of your ideas and I’ve run into two problems. Using umenu I can’t seem to get the ‘prepend set’ command to work and subsequently change the label. And, like you said, swieser1, the message box changes colour on other machines!


May 4, 2007 | 9:46 am

Right, I’ve fixed my problem and here’s the solution for anyone interested.

Using GT’s method I used the command ‘prepend set setitem 0′ (instead of ‘prepend set’) such that when a file is loaded into the ‘info~’ object the output file name becomes ‘setitem 0 ‘.

To automatically update my umenu (in label mode), I used the ‘deferlow’ object to bang the message box containing ‘setitem 0 ‘ such that everytime a new file is loaded into the ‘info~’ object it is automatically updated.

Thanks for your help again guys!



FP
May 4, 2007 | 10:43 am


May 4, 2007 | 11:19 am

I want to try and keep it as simple as possible to conserve CPU power (as my plugin already uses a fair amount).


May 4, 2007 | 12:33 pm

On 4 mai 07, at 13:19, Chris Robson wrote:

> I want to try and keep it as simple as possible to conserve CPU
> power (as my plugin already uses a fair amount).

panel in black, comment in white?

ej


May 4, 2007 | 12:33 pm

You can also choose the numbox background color in its inspector (Cmd+I). This will show up correctly on every computer.

Mattijs

Quote: swieser1 wrote on Fri, 04 May 2007 03:23
—————————————————-
> go to options menu, select Colors…
>
> set one of the colors to black
>
> go back to your message box, right click (or ctrl-click), select the Color submenu, select the black box.
>
> lock the patch
>
> voila, you have a message box with black background and white text.
>
> the only drawback is that I think this will only work on your computer. if you tried to send this patch to someone, the message box would probably show up with the standard color that was originally in the box that you changed to black.
>
> i think there may be a super top secret way to change people’s default colors using a scripting message to the max object or something… although i don’t think most people would appreciate you messing with their colors…
>
> you could make a pretty simple jsui object that displays the text you input to it, and you can make the text and the background whatever color you want…
>
> -scott
—————————————————-


May 4, 2007 | 3:12 pm

Quote: Emmanuel Jourdan wrote on Fri, 04 May 2007 13:33
—————————————————-
> On 4 mai 07, at 13:19, Chris Robson wrote:
>
> > I want to try and keep it as simple as possible to conserve CPU
> > power (as my plugin already uses a fair amount).
>
> panel in black, comment in white?
>
> ej
>
—————————————————-

Unless I’m mistaken, you can’t dynamically update a comment box as it has no inlets. The only solution I could come up with was the message box, but I’m using the umenu (which seems to work very well).


May 4, 2007 | 3:39 pm


May 4, 2007 | 3:45 pm


May 4, 2007 | 6:20 pm

> Unless I’m mistaken, you can’t dynamically update a comment box as it has no inlets. The only solution I could come up with was the message box, but I’m using the umenu (which seems to work very well).

In fact, using scripting to thispatcher you can set the content of
comments on the fly. At times there might be redraw issues, so you
should send them to the front after changing the content.

Best,
Trond


May 4, 2007 | 8:54 pm

> umenu in label mode. Use the Inspector to set this mode, color etc.

right.

or use [lcd] if you like it complicated.


May 7, 2007 | 3:29 pm

Chris Robson schrieb:
> Unless I’m mistaken, you can’t dynamically update a comment box as it
> has no inlets. The only solution I could come up with was the message
> box, but I’m using the umenu (which seems to work very well).

I think your solution is better, but I can’t leave the first statement
uncommented… (might be usefull for other occasions…)
The fontlist might only work on a Mac…

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P hidden newex 43 360 41 196617 b 3;
#P hidden message 332 463 60 196617 255 255 0;
#P button 203 349 15 0;
#P hidden newex 177 392 130 196617 t b b i b;
#P hidden newex 177 370 76 196617 loadmess 255;
#N vpatcher 20 74 522 465;
#P window setfont "Sans Serif" 9.;
#P message 50 258 229 196617 script send wow frgb $1 $2 $3;
#P newex 132 105 27 196617 t b i;
#P newex 132 132 27 196617 +;
#P newex 92 105 33 196617 < < 16;
#P newex 50 83 52 196617 unpack s i;
#P newex 50 138 13 196617 b;
#P newex 50 165 42 196617 zl reg;
#P newex 338 209 50 196617 tosymbol;
#P newex 50 187 298 196617 t b script l;
#P newex 104 232 244 196617 sprintf %s replace wow comment 30 30 800 %i %s;
#P inlet 266 70 15 0;
#P inlet 132 64 15 0;
#P inlet 50 63 15 0;
#P inlet 22 63 15 0;
#P outlet 50 292 15 0;
#P connect 2 0 10 0;
#P connect 13 0 9 0;
#P connect 11 0 9 0;
#P fasten 1 0 8 0 27 159 55 159;
#P connect 9 0 8 0;
#P connect 8 0 6 0;
#P connect 4 0 14 0;
#P connect 6 0 14 0;
#P connect 14 0 0 0;
#P connect 5 0 0 0;
#P connect 10 1 11 0;
#P connect 6 1 5 0;
#P connect 3 0 13 0;
#P fasten 11 0 12 0 97 127 137 127;
#P connect 13 0 12 0;
#P connect 13 1 12 1;
#P connect 12 0 5 1;
#P connect 6 2 7 0;
#P connect 7 0 5 2;
#P pop;
#P newobj 139 497 240 196617 p control comment wow;
#P user uslider 655 416 13 35 256 1 0 0;
#N vpatcher 14 284 480 558;
#P inlet 354 49 15 0;
#P outlet 354 122 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 354 98 69 196617 saturation $1;
#P window linecount 0;
#P newex 224 98 65 196617 prepend frgb;
#P newex 157 98 65 196617 prepend brgb;
#P outlet 157 122 15 0;
#P newex 291 98 61 196617 prepend set;
#P newex 106 71 61 196617 prepend set;
#P newex 87 98 67 196617 prepend brgb;
#P inlet 87 49 15 0;
#P inlet 106 49 15 0;
#P outlet 291 122 15 0;
#P outlet 87 122 15 0;
#P connect 3 0 4 0;
#P connect 5 0 4 0;
#P connect 4 0 0 0;
#P connect 2 0 5 0;
#P fasten 3 0 8 0 92 93 162 93;
#P connect 8 0 7 0;
#P fasten 9 0 7 0 229 118 162 118;
#P fasten 3 0 9 0 92 93 229 93;
#P fasten 3 0 6 0 92 93 296 93;
#P connect 6 0 1 0;
#P connect 12 0 10 0;
#P connect 10 0 11 0;
#P pop;
#P hidden newobj 525 470 140 196617 p connect left outlet…;
#P message 525 452 70 196617 0 21 154;
#P user umenu 597 451 56 196647 1 64 467 1;
#X add brgb;
#X add frgb;
#X add rgb2;
#X add rgb3;
#X add rgb4;
#P user swatch 525 416 128 32;
#P window linecount 2;
#P message 262 528 74 196617 ; max refresh;
#P number 297 429 35 9 9 255 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 367 396 69 196617 saturation $1;
#P message 139 463 36 196617 wow;
#P message 99 463 36 196617 Hallo;
#P user uslider 351 396 13 35 256 1 0 0;
#P user swatch 367 415 128 32;
#P hidden newex 73 384 86 196617 loadmess mode 1;
#P user ubumenu 73 429 220 196617 0 1 1 0;
#X add;
#X prefix_set 0 0 0;
#P hidden newex 73 406 41 196617 fontlist;
#B color 5;
#N thispatcher;
#Q end;
#P newobj 139 536 71 196617 thispatcher;
#P window setfont "Sans Serif" 255.;
#P comment 30 30 800 196863 wow;
#B frgb 255 255 0;
#P objectname wow;
#P window setfont "Sans Serif" 9.;
#P comment 294 410 45 196617 font size;
#P comment 145 351 54 196617 initialise:;
#P user panel 20 11 763 320;
#X brgb 0 21 154;
#X frgb 0 21 154;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P background;
#P hidden connect 22 0 25 0;
#P hidden connect 25 2 7 0;
#P hidden fasten 25 1 6 0 63 426 78 426;
#P hidden fasten 25 0 6 0 48 426 78 426;
#P hidden fasten 18 1 0 0 573 574 25 574;
#P hidden connect 7 0 5 0;
#P hidden connect 5 0 6 0;
#P hidden connect 9 0 12 0;
#P connect 12 0 8 0;
#P hidden fasten 18 3 15 0 659 492 530 492;
#P hidden fasten 18 2 17 0 616 492 521 492 521 450 530 450;
#P hidden connect 15 0 18 0;
#P hidden fasten 16 1 18 1 648 468 595 468;
#P hidden connect 19 0 18 2;
#P connect 20 0 4 0;
#P connect 10 0 20 0;
#P connect 11 0 20 0;
#P connect 6 1 20 1;
#P connect 13 0 20 2;
#P connect 8 0 20 3;
#P hidden connect 22 2 13 0;
#P hidden connect 22 1 11 0;
#P hidden connect 21 0 22 0;
#P hidden connect 24 0 20 3;
#P hidden connect 22 3 24 0;
#P hidden connect 23 0 21 0;
#P window clipboard copycount 26;


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


May 7, 2007 | 5:47 pm

Indeed, you can send comments a frgb message using "send frgb # # #", as well as set the text. Lots of other objects can accept these messages too, though most can take them in inlets.

For number boxes you can also dynamically change their appearance, not just colors, but also whether transparent or not, bold, etc. "flags 0" = normal, flags 4 = bold, flags 8192 = transparent, flags 8196 = bold transparent (find these buried in the number inspector). So you can choose whether to see the box, as it’s sometimes nice to be able to see the little triangle.

You can also select boxes automatically with the select message, and the right outlet of the number box will bang if it’s selected and you hit Tab. Attach to a select message and attach that to the next box you want to jump to, so you can tab through series of number boxes.

The colors message is controllable, unlock the Colors panel and see how to format them to send to Max. Then you can control what colors people see for a number of objects (anything that takes color $1).

–CJ


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