get editbox text

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Simius

get editbox text

Post by Simius »

Hi,
i created an editbox in my gui and now i don't know how i should get the text of the box.
first i thought to record the key events in my event receiver, but that whould be a too long code.
then i saw in the irrlicht code in CGUIEditBox.cpp that there is a variable called Text, which i think is the text i want to have, so how do i get to this text? i didnt' find a function whcich returns me this text and i don't want to edit the irrlich code yet.
thx already
eT.
Mr.Gluck
Posts: 82
Joined: Tue Aug 31, 2004 8:02 pm

...

Post by Mr.Gluck »

s = root->getElementFromId(901, true)->getText();

look examples
Simius

..thx

Post by Simius »

there's nothing in the examples, but api...
anyway...thanks a lot.
eT.
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

try this


case EGET_BUTTON_CLICKED:

switch(id)
{
case 1101:
{
//get info from editbox and output to listbox
gui::IGUIElement* root = env->getRootGUIElement();
listbox->addItem(root->getElementFromId(901, true)->getText());

}
break;

this is a function mapped out to a button
sivagiri
Posts: 22
Joined: Sat Jun 10, 2006 4:31 pm

hi

Post by sivagiri »

:o Whats the name of the editbox you're taken the info from: cause in my window I have a few editbox and I only want to take info from one?


sivagiri :lol:
sivagiri
Posts: 22
Joined: Sat Jun 10, 2006 4:31 pm

wow

Post by sivagiri »

Thx

I got it.
:lol:

patientListBox->addItem(nameEb->getText());

It works.

nameEb is my editbox name.
:oops:
sivagiri
Posts: 22
Joined: Sat Jun 10, 2006 4:31 pm

remove

Post by sivagiri »

Now how can I remove an selected item from ListBox?

sivagiri
Post Reply