Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
how to transfer one string from one edit box to list box

Subject: how to transfer one string from one edit box to list box

From: Sertan Kaya

Date: 9 Dec, 2008 06:20:19

Message: 1 of 7

I have a gui project, and I need to transfer a string from an edit box to the list box in my gui template. If you assist me, I will be more than happy.

Thanks

Subject: how to transfer one string from one edit box to list box

From: Justus Skorps

Date: 9 Dec, 2008 07:27:33

Message: 2 of 7

1. read the string from the edit box
2. read the content from the list box
3. place the string from the edit box to the end of the content of the
list box
4. put the changed content back to the list box

..how to do the single steps rtfm..

Subject: how to transfer one string from one edit box to list box

From: Sertan Kaya

Date: 9 Dec, 2008 20:36:02

Message: 3 of 7

Dear Mr. Skorps,

 How to read that ? By using handle thing or another method ? Is there any way you may put code of each step if you dont mind ?

What i am trying to do is that I would like to add a new food type to move to the my all foods list box. I also need to do remove any food from the list. I just kind of got lost on that. If you enlight me at this point by using codes, I will appreciate to you. Thanks for your valuable time.

Sincerely,
Sertan
Grad at LSU




Justus Skorps <jussa@gmx.de> wrote in message <212a5adb-80d0-484b-95e7-c80e5c0b213a@w39g2000prb.googlegroups.com>...
> 1. read the string from the edit box
> 2. read the content from the list box
> 3. place the string from the edit box to the end of the content of the
> list box
> 4. put the changed content back to the list box
>
> ..how to do the single steps rtfm..

Subject: how to transfer one string from one edit box to list box

From: someone

Date: 9 Dec, 2008 21:05:05

Message: 4 of 7

"Sertan Kaya" <sertan_kaya@yahoo.com> wrote in message <ghmkri$ahn$1@fred.mathworks.com>...
> Dear Mr. Skorps,
>
> How to read that ? By using handle thing or another method ? Is there any way you may put code of each step if you dont mind ?
>
> What i am trying to do is that I would like to add a new food type to move to the my all foods list box. I also need to do remove any food from the list. I just kind of got lost on that. If you enlight me at this point by using codes, I will appreciate to you. Thanks for your valuable time.
>
> Sincerely,
> Sertan
> Grad at LSU
>
>
>
>
> Justus Skorps <jussa@gmx.de> wrote in message <212a5adb-80d0-484b-95e7-c80e5c0b213a@w39g2000prb.googlegroups.com>...
> > 1. read the string from the edit box
> > 2. read the content from the list box
> > 3. place the string from the edit box to the end of the content of the
> > list box
> > 4. put the changed content back to the list box
> >
> > ..how to do the single steps rtfm..

% Here's a bit more detail:

% Step 1: Assume editH is the handle to the edit box
editText = get(editH,'String');
% Step 2: Assume listH is the handle to the list box
listText = get(listH,'String');
% Step 3 Assume texts are each row vectors
newListText = [listText editText];
% Step 4: replace list box text
set(listH,'String',newListText)

% The above is just an example.
% Your mileage may vary.
% If you need more help, you shoud really read the MATLAB GUI documentation.

Subject: how to transfer one string from one edit box to list box

From: Chris

Date: 9 Dec, 2008 21:06:03

Message: 5 of 7

"Sertan Kaya" <sertan_kaya@yahoo.com> wrote in message <ghmkri$ahn$1@fred.mathworks.com>...
> Dear Mr. Skorps,
>
> How to read that ? By using handle thing or another method ? Is there any way you may put code of each step if you dont mind ?
>
> What i am trying to do is that I would like to add a new food type to move to the my all foods list box. I also need to do remove any food from the list. I just kind of got lost on that. If you enlight me at this point by using codes, I will appreciate to you. Thanks for your valuable time.
>
> Sincerely,
> Sertan
> Grad at LSU
>
>
>
>
> Justus Skorps <jussa@gmx.de> wrote in message <212a5adb-80d0-484b-95e7-c80e5c0b213a@w39g2000prb.googlegroups.com>...
> > 1. read the string from the edit box
> > 2. read the content from the list box
> > 3. place the string from the edit box to the end of the content of the
> > list box
> > 4. put the changed content back to the list box
> >
> > ..how to do the single steps rtfm..

I would use get for parts 1 and 2, and set for 4. There may be a better way to do this that I'm not aware of though.
Chris

Subject: how to transfer one string from one edit box to list box

From: someone

Date: 9 Dec, 2008 21:20:03

Message: 6 of 7

"Chris " <chris.crawshaw@gmail.com> wrote in message <ghmmjq$lnr$1@fred.mathworks.com>...
> "Sertan Kaya" <sertan_kaya@yahoo.com> wrote in message <ghmkri$ahn$1@fred.mathworks.com>...
> > Dear Mr. Skorps,
> >
> > How to read that ? By using handle thing or another method ? Is there any way you may put code of each step if you dont mind ?
> >
> > What i am trying to do is that I would like to add a new food type to move to the my all foods list box. I also need to do remove any food from the list. I just kind of got lost on that. If you enlight me at this point by using codes, I will appreciate to you. Thanks for your valuable time.
> >
> > Sincerely,
> > Sertan
> > Grad at LSU
> >
> >
> >
> >
> > Justus Skorps <jussa@gmx.de> wrote in message <212a5adb-80d0-484b-95e7-c80e5c0b213a@w39g2000prb.googlegroups.com>...
> > > 1. read the string from the edit box
> > > 2. read the content from the list box
> > > 3. place the string from the edit box to the end of the content of the
> > > list box
> > > 4. put the changed content back to the list box
> > >
> > > ..how to do the single steps rtfm..
>
> I would use get for parts 1 and 2, and set for 4. There may be a better way to do this that I'm not aware of though.
> Chris

AFAIK, there are no "better" ways.
See my example above.
You just have to jump in, the waters fine.

Subject: how to transfer one string from one edit box to list box

From: Justus Skorps

Date: 10 Dec, 2008 07:59:12

Message: 7 of 7

> AFAIK, there are no "better" ways.
> See my example above.


and guess what, if the thread starter would have entered "edit
text" (not much imagination needed to try this key words...) in the
matlab help index, this would have appeared on the right side ('To
obtain the string a user types in an edit box,[...]') ...but of course
it is much easier (and faster) to let do this other people in a
newsgroup...that's why I did not post any commands, such simple things
can be solved easily with the matlab help (that is its purpose) and
everybody should try to solve his problems himself before asking other
people or even try it what the thread starter has appearently not
done...

fortunately your code is not completly correct ;c)

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us