Retrieving User Input Text to label a GUI

Jan 20, 2007 at 8:41pm

Retrieving User Input Text to label a GUI

Hi,

This is probably a really basic question but I’ll ask it anyway as I am stuck. I need to allow a user to input text (to name a field) and the name that they have typed appear in a message box or other appropriate object to label part of a GUI. I know of the textedit object for a user to type in but I cannot find any way of retrieving the text to display elsewhere.

Any ideas?

Many Thanks

Andy

#29824
Jan 20, 2007 at 9:07pm

Use the pak object to store the text and the set $1 command to retrieve it elsewhere.

If I could see an example of what you are working with I could explain it better and perhaps be of some help.

Thanks

Rhys

#93853
Jan 20, 2007 at 9:19pm

Hi,

Thanks for the quick reply. I think the best way to demonstrate what I want to do is by showing you an image of my GUI as it stands at the moment. I have attached an annotated picture for you to look at.

Many Thanks

#93854
Jan 20, 2007 at 9:34pm

On 20 janv. 07, at 22:19, Andy Brennan wrote:

> Hi,
>
> Thanks for the quick reply. I think the best way to demonstrate
> what I want to do is by showing you an image of my GUI as it stands
> at the moment. I have attached an annotated picture for you to look
> at.

For those kind of things, as you’re working on a very elaborate
designed interface, I would recommend using the lcd object to display
the text over an image (put the image in background of you’re lcd,
use the write message to add the text), or even the jsui object if
you know JavaScript.

Best,
ej

#93855
Jan 20, 2007 at 9:54pm

Something like this perhaps….

max v2;
#N vpatcher 387 44 1663 800;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 401 335 62 196617 prepend set;
#P message 401 370 81 196617 text swww;
#P button 456 224 15 0;
#P newex 539 378 110 196617 if $i1 == 13 then bang;
#P flonum 539 351 84 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 2;
#P comment 650 280 100 196617 Type text and press enter to send;
#P user textedit 453 276 631 299 32900 3 9 swww;
#P window linecount 1;
#P comment 289 370 100 196617 ends up here —>;
#P connect 1 0 7 0;
#P connect 7 0 6 0;
#P connect 5 0 1 0;
#P fasten 4 0 5 0 460 483 354 378 346 167 440 180;
#P connect 1 1 3 0;
#P connect 3 0 4 0;
#P pop;

#93856
Jan 21, 2007 at 12:08pm

I like using umenu and ubumenu for labels, like this:

#P window setfont “Sans Serif” 9.;
#P user ubumenu 271 273 121 196617 0 0 1 1;
#X add -none-;
#X prefix_set 0 0 0;
#P noclick;
#P user umenu 271 228 121 196647 3 64 244 0;
#X setrgb 255 255 255 221 221 221 255 255 255 221 221 221 170 170 170
119 119 119 187 187 187;
#X add -none-;
#P user umenu 271 253 121 196647 1 64 269 1;
#X setrgb 255 255 255 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50
50 50;
#X add -none-;
#P noclick;
#P user umenu 271 205 121 196647 3 64 221 0;
#X setrgb 255 255 255 221 221 221 255 255 255 221 221 221 170 170 170
119 119 119 187 187 187;
#X add -none-;
#P window linecount 1;
#P newex 70 139 56 196617 route text;
#P newex 70 162 91 196617 prepend setitem 0;
#P button 70 86 15 0;
#P user textedit 70 111 174 131 32932 3 9 -none-;
#P user panel 270 227 122 18;
#X brgb 71 111 54;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user fpic 261 166 170 151 fpic_house.pict 0 0 0 0. 0 0 0;
#P hidden connect 4 0 6 0;
#P hidden connect 4 0 8 0;
#P hidden connect 4 0 7 0;
#P hidden connect 4 0 9 0;
#P connect 2 0 5 0;
#P connect 5 0 4 0;
#P connect 3 0 2 0;
#P window clipboard copycount 10;

#93857
Jan 22, 2007 at 2:45am

That looks pretty cool… nice work on the design! I need to spend more time on that part of development.

Here’s a bit more on the text entry, an extension of Dr. Spankenstein’s patch, hope it helps:

-C

max v2;
#N vpatcher 100 86 768 588;
#P window setfont “Sans Serif” 9.;
#P window linecount 5;
#P comment 111 406 178 9109513 use tosymbol to manage spaces ; note that semicolons and commas are removed/replaced with spaces ; not needed in your case , but often is when dealing with filenames etc.;
#P window linecount 1;
#P newex 304 385 62 9109513 prepend set;
#B color 1;
#P message 304 413 213 9109513 “slkgjwe lskj glk sdlkgj”;
#B color 1;
#P newex 304 356 62 9109513 tosymbol;
#B color 1;
#P comment 362 294 100 9109513 (enter);
#P comment 257 101 100 9109513 auto-clears upon send;
#P newex 161 231 62 9109513 route text;
#P newex 147 118 62 9109513 del 50;
#P message 138 145 81 9109513 clear;
#P newex 156 264 62 9109513 prepend set;
#P window linecount 3;
#P message 142 288 45 9109513 slkgjwe lskj glk sdlkgj;
#P button 222 104 15 0;
#P window linecount 1;
#P newex 339 273 110 9109513 if $i1 == 13 then bang;
#P flonum 339 246 84 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 2;
#P comment 412 195 100 9109513 Type text and press enter to send;
#P user textedit 215 191 393 214 32900 139 9;
#P window linecount 1;
#P comment 16 284 100 9109513 ends up here —>;
#P connect 9 0 8 0;
#P connect 7 0 6 0;
#P connect 5 0 9 0;
#P connect 10 0 7 0;
#P connect 1 0 10 0;
#P connect 8 0 1 0;
#P connect 5 0 1 0;
#P fasten 4 0 5 0 222 398 116 293 108 82 202 95;
#P fasten 10 0 13 0 266 262 324 320;
#P lcolor 2;
#P connect 13 0 15 0;
#P lcolor 2;
#P connect 15 0 14 0;
#P lcolor 2;
#P connect 1 1 3 0;
#P connect 3 0 4 0;
#P pop;

#93858
Jan 22, 2007 at 6:07pm

Thanks for the help guys. I ended up going for the UBUMENU object as label. Its a bit limiting due to the fact that the background can’t be transparent but I can work around that.

The main advantage I have found is that the size of the box does not change if a long name is input. The problem I had with the message box ideas was that a long field name would enlarge the message box and mess up my design.

many Thanks

Andy

#93859
Jan 23, 2007 at 12:16pm

Andy Brennan wrote:
> Thanks for the help guys. I ended up going for the UBUMENU object as
> label. Its a bit limiting due to the fact that the background can’t
> be transparent but I can work around that.

It looks as you want to make a nice pluggo. But ubumenu doesn’t work in
pluggos (Its a VST limitation). You should take the umenu in transparent
mode and add some spaces to center the text if necessary…

> and mess up my design.

Yes, don’t mess it, congratualtion to the design, its very beautiful,
and I would like to know how you made these nice 3D knobs, maybe you
want to share some secrets like give a hands on tutorial how you created
them?

Stefan


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

#93860
Jan 23, 2007 at 1:20pm

I get success using a jit.cellblock with only one cell, in place-edit
mode (5), with a center justification. Link it to a named texedit, which
is also linked to the jit.cellblock, then the pattr system will always
remember it !

Take a pattrstorage, put this in a bpatcher, select the label area,
enter text, save preset, do a few, recall, magic….

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 301 162 106 9109513 autopattr @autoname 0;
#X prestore text_ID 6 0 – - – - – -;
#P objectname u086000673;
#P hidden newex 175 211 48 9109513 route text;
#P hidden newex 175 249 89 9109513 prepend set current;
#P hidden newex 188 116 57 9109513 prepend set;
#P hidden newex 188 89 37 9109513 route 0;
#P hidden newex 188 60 37 9109513 route 0;
#P hidden user textedit 175 149 275 199 32896 139 9 – - – - – -;
#P objectname text_ID;
#P user jit.cellblock 60 91 119 130 3 14 1 1 59 39 0 1 1 0 0 0 0 0 5 255
255 255 17 17 17 0 0 0 0 0 0 0 0 0 255 255 255 255 255 255 0 0 0 0 4
600268504 600263040 1;
#P hidden connect 5 0 0 0;
#P hidden connect 4 0 1 0;
#P hidden connect 1 0 6 0;
#P hidden connect 6 0 5 0;
#P hidden connect 0 0 2 0;
#P hidden connect 2 0 3 0;
#P hidden connect 3 0 4 0;
#P window clipboard copycount 8;

f.e

f.e chanfrault | aka | personal computer music
> >>>>>> http://www.personal-computer-music.com
> >>>>>> |sublime music for a desperate people|

Stefan Tiedje wrote:
> Andy Brennan wrote:
>> Thanks for the help guys. I ended up going for the UBUMENU object as
>> label. Its a bit limiting due to the fact that the background can’t
>> be transparent but I can work around that.
>
> It looks as you want to make a nice pluggo. But ubumenu doesn’t work
> in pluggos (Its a VST limitation). You should take the umenu in
> transparent mode and add some spaces to center the text if necessary…
>
>> and mess up my design.
>
> Yes, don’t mess it, congratualtion to the design, its very beautiful,
> and I would like to know how you made these nice 3D knobs, maybe you
> want to share some secrets like give a hands on tutorial how you
> created them?
>
> Stefan
>

#93861

You must be logged in to reply to this topic.