S or /

Class Mutable

from egui import Mutable
class Mutable:

A Mutable object wraps a value so it can be set with .set() and accessed with .get(). This is used by widgets that set a value based on user input. The following example uses a Mutable to wrap a string editable through a text field.

        ...
        self.single_line_text_input = egui.Mutable("")
        ...

        ui.add(egui.TextEdit.singleline(self.single_line_text_input))
        ui.add_space(10)
        ui.label("Lowercase text:")
        ui.label(self.single_line_text_input.get().lower())
        ...
Source

Methods§

def get(self, /) -> Any§
def set(self, /, value: Any) -> None§