Skip to content

GuiText manipulating underlying string #3

@V10lator

Description

@V10lator

Code says more than thousand words:

// CODE:

	debugPrintf("Asked to add \"%s\"", str);
	
	GuiText *text = new GuiText(str);
	
	text->setPosition(row * 24, column * 24);
	text->setMaxWidth(tvWidth - (row * 24) - 100, GuiText::SCROLL_HORIZONTAL);
	
	debugPrintf("Adding \"%s\" at %d/%d", text->toUTF8().c_str(), row * 24, column * 24);
	
	tvWindow->append(text);

/* OUTPUT:
 * Asked to add "Could not download from"
 * Adding "Could not download fromw" at 0/0
 * Asked to add "http://enter.that.title.key/site/here"
 * Adding "http://enter.that.title.key/site/herezKH" at 0/24
 * Asked to add "Press (A) to enter a new URL"
 * Adding "Press (A) to enter a new URL" at 0/72
 * Asked to add "Press (B) to exit"
 * Adding "Press (B) to exit�" at 0/96
 */

So it added "w" at the end of the first string, "zKH" at the end of the second, correctly handled the third and added one unprintable char to the end of the fourth.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions