Page 1 of 1

get editbox text

Posted: Sat Oct 02, 2004 4:08 pm
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.

...

Posted: Sat Oct 02, 2004 5:29 pm
by Mr.Gluck
s = root->getElementFromId(901, true)->getText();

look examples

..thx

Posted: Sat Oct 02, 2004 7:27 pm
by Simius
there's nothing in the examples, but api...
anyway...thanks a lot.
eT.

Posted: Mon Oct 04, 2004 1:46 am
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

hi

Posted: Wed Sep 13, 2006 3:15 pm
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:

wow

Posted: Wed Sep 13, 2006 3:53 pm
by sivagiri
Thx

I got it.
:lol:

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

It works.

nameEb is my editbox name.
:oops:

remove

Posted: Wed Sep 13, 2006 4:15 pm
by sivagiri
Now how can I remove an selected item from ListBox?

sivagiri