Skip to main content
WLewe
Associate III
November 5, 2019
Solved

I was attempting to put a keyboard inside a modal window. When I run the simulator and try to open up my modal window I get "Assertion failed!... Cannot add Drawable multiple times"

  • November 5, 2019
  • 1 reply
  • 1256 views
void MainScreenView::setVacuumPositionPercentBoxClickHandler(const BoxWithBorder& b, const ClickEvent& evt)
{
	// When target vacuum position box is clicked, display modal keypad with numericals
	targetPercentModalWindow.setVisible(true);
	targetPercentModalWindow.invalidate();
 
	keyboard.setPosition(410, 100, 320, 240);
	add(keyboard);
 
}

This is the code where I make the modal window visible and draw the keyboard.

This topic has been closed for replies.
Best answer by Martin KJELDSEN

You've answered your own question :) You're adding the keyboard every time you click that box.

You only need to add a Drawable to the root container of a view ONCE.

/Martin

1 reply

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
November 5, 2019

You've answered your own question :) You're adding the keyboard every time you click that box.

You only need to add a Drawable to the root container of a view ONCE.

/Martin

WLewe
WLeweAuthor
Associate III
November 5, 2019

Where would I find the root container for my modal window?