SourceEnum WidgetText
from egui import WidgetTextclass WidgetText:This is how you specify text for a widget.
A lot of widgets use impl Into<WidgetText> as an argument,
allowing you to pass in String, RichText, LayoutJob, and more.
Often a WidgetText is just a simple String,
but it can be a RichText (text with color, style, etc),
a LayoutJob (for when you want full control of how the text looks)
or text that has already been laid out in a Galley.
You can color the text however you want, or use Color32.PLACEHOLDER
which will be replaced with a color chosen by the widget that paints the text.
Methods§
@staticmethod
def Galley(galley: Galley) -> WidgetText§
@staticmethod
def LayoutJob(job: LayoutJob) -> WidgetText§
@staticmethod
def RichText(text: RichText) -> WidgetText§
@staticmethod
def Text(text: str) -> WidgetText§
Sourcedef background_color(self, /, color: Color32) -> WidgetText§
Prefer using RichText directly!
Sourcedef code(self, /) -> WidgetText§
Prefer using RichText directly!
Sourcedef color(self, /, color: Color32) -> WidgetText§
Sourcedef fallback_text_style(self, /, text_style: TextStyle) -> WidgetText§
Sourcedef heading(self, /) -> WidgetText§
Prefer using RichText directly!
Sourcedef into_galley(self, /, ui: Ui, wrap_mode: TextWrapMode |None, available_width: float, fallback_font: FontSelection |None = None) -> Galley§
Layout with wrap mode based on the containing Ui.
wrap_mode: override for Ui.wrap_mode
Sourcedef into_galley_impl(self, /, ctx: Context, style: Style, text_wrapping: TextWrapping, fallback_font: FontSelection |None = None, default_valign: Align |None = None) -> Galley§
Sourcedef into_layout_job(self, /, style: Style, fallback_font: FontSelection |None = None, default_valign: Align |None = None) -> LayoutJob§
Sourcedef is_empty(self, /) -> bool§
Sourcedef italics(self, /) -> WidgetText§
Prefer using RichText directly!
Sourcedef monospace(self, /) -> WidgetText§
Prefer using RichText directly!
Sourcedef raised(self, /) -> WidgetText§
Prefer using RichText directly!
@staticmethod
def rich_text(text: RichText) -> WidgetText§
Sourcedef small(self, /) -> WidgetText§
Prefer using RichText directly!
Sourcedef small_raised(self, /) -> WidgetText§
Prefer using RichText directly!
Sourcedef strikethrough(self, /) -> WidgetText§
Prefer using RichText directly!
Sourcedef strong(self, /) -> WidgetText§
Prefer using RichText directly!
Source@staticmethod
def text(text: str) -> WidgetText§
Sourcedef text_style(self, /, text_style: TextStyle) -> WidgetText§
def text_value(self, /) -> str§
Sourcedef underline(self, /) -> WidgetText§
Prefer using RichText directly!
Sourcedef weak(self, /) -> WidgetText§
Prefer using RichText directly!