The SimpleCxxLib package


#include "ginteractors.h"

class GTextField : public GInteractor

This interactor subclass represents a text field for entering short text strings. Hitting enter in a text field generates a GActionEvent if the text field has a nonempty action command.
Constructor
GTextField()
GTextField(nChars) 
Creates a text field capable of holding nChars characters, which defaults to 10.
Methods
getText() Returns the contents of the text field.
setText(str) Sets the text of the field to the specified string.

Constructor detail


GTextField();
GTextField(int nChars);
Creates a text field capable of holding nChars characters, which defaults to 10. Assigning an action command to the text field causes it to generate an action event whenever the user types the ENTER key.

Usage:

GTextField *field = new GTextField();
GTextField *field = new GTextField(nChars);

Method detail


void setText(string str);
Sets the text of the field to the specified string.

Usage:

field->setText(str);

string getText();
Returns the contents of the text field.

Usage:

string str = field->getText();