Button With Image, Background Image and Text
Hi all,
I'm working on an application, and I want to have a button with an image and a background. Lucky for me, there already is such a widget! The ButtonWithIcon class is a derivative of the Button.
I also want my button to have a label. So now I'm writing a derivative of ButtonWithIcon with a TextArea widget added. However, this text area is not being drawn.
I have tried everything. II have tried to make my derivative class a friend of container, because the button is a widget, and I cannot add children. But the ButtonWithIcon has both an icon and a background image, so these should be children, right?
I have tried to draw the rect of the text area, like this:
in .hpp:
touchgfx::TextArea _label;
in .cpp
_label.setY(0);
_label.setX(0);
_label.setTypedText(TypedText(title_id));
_label.resizeToCurrentText();
draw(_label.getRect());Is it perhaps simply not possible to add children to the widget class? Or maybe I should use another class? I don't understand it.
Thank you for reading.
