TextButton
A button with no background and border.
Properties
text
(in string): The text written in the button.icon
(in image): The image to show in the button.enabled
(in bool): If set tofalse
the button is disabled.has_hover
(out bool): Button sets this totrue
when the mouse is over it.has_focus
(out bool): Button sets this totrue
when the area has keyboard focus.pressed
(out bool): Set totrue
by the button when the mouse is pressed over it.enter_pressed
(out bool): Set totrue
by the button when the area has focus and enter key is pressed.style
(in ButtonStyle): Defines the style of the button.icon_style
(outIconStyle
): Gets the style of the icon of the button.text_style
(outTextStyle
): Gets the style of the text of the button.
Callbacks
clicked()
: Invoked when clicked: A finger or the left mouse button is pressed, then released on this element.
Example
import { TextButton, VerticalBox } from "@coop/pure.slint";
export component Example inherits Window {
VerticalBox {
TextButton {
text: "Click Me";
clicked => { self.text = "Clicked"; }
}
}
}