AutoGUI Application
The main entry point. Use the app object to configure the window, load screens, and handle global logic.
main=True, this screen appears immediately.app.register_screen("login", "login.json", main=True)
app.switch_screen("dashboard")
app.set_title("My Secure App v1.0")
app.set_background("#f0f2f5")
app.set_icon("assets/icon.png")
Label
Displays text or Material Icons. Supports dynamic text updates.
app.home.lbl_status.text("Connected")
app.home.lbl_error.text_color("#ff0000")
app.home.lbl_header.font_size(24)
app.home.lbl_loading.set_visible(True)
TextBox / TextArea
Input fields for user text. TextBox is single-line, TextArea is multi-line.
username = app.login.txt_user.text()
app.login.txt_user.text("") # Clear
app.login.txt_user.set_enabled(False)
app.login.txt_user.text_color("#333333")
Image
Display images. Supports transparent backgrounds and loading from URLs.
app.profile.avatar.from_url("https://example.com/pic.png")
app.profile.avatar.update_image("assets/new_avatar.png")
"contain", "cover", "fill", or "none".app.profile.avatar.set_fit("cover")
app.profile.avatar.set_visible(False)
app.profile.avatar.opacity(0.8)
CardView / Panel
Containers for layout. Can be made clickable if listed in "hybrids" in JSON.
app.home.panel_main.bg_color("#ffffff")
app.home.panel_main.border(2, "#e2e8f0")
app.home.panel_main.on_click(lambda: print("Card Clicked"))
app.home.panel_main.set_visible(False)
Checkbox
Standard tick box for boolean selection.
if app.form.chk_agree.is_checked():
submit_form()
app.form.chk_agree.on_toggle(lambda: validate())
Toggle Switch
Modern sliding switch.
enabled = app.settings.sw_notify.is_on()
app.settings.sw_notify.on_toggle(lambda: update_prefs())
Slider
Draggable range selector.
volume = app.settings.slider_vol.get()
app.settings.slider_vol.set(50)
ProgressBar
Visual indicator of completion.
app.loader.pbar.set(75)
Spinner
Number input with up/down buttons.
qty = app.cart.spin_qty.get()
app.cart.spin_qty.set(1)
Dropdown
Button that opens a selection menu.
country = app.form.dropdown_country.get()
app.form.dropdown_country.on_select(lambda val: print(val))
RadioGroup
A set of mutually exclusive options.
gender = app.form.radio_gender.get()
Animation System
Move and align widgets dynamically. Animations use a "Builder Pattern" where you chain commands together.
"move to center", "align", "move to position", "restore".0.1 = 10% of screen size.Positive X = Right, Negative X = Left.
Positive Y = Up, Negative Y = Down.
# Full Example
app.animate("move to center")\
.apply_to("game.token")\
.end_at("game.slot_1")\
.offset_y(0.05)\
.with_duration(0.5)\
.start()
Cloning System
Dynamically duplicate components at runtime (e.g., for shop items or lists).
- ids: Comma-separated list of child widgets (buttons, labels).
- base_id: The container ID (CardView) that holds the children. This is required for relative positioning.
- id: Name your template.
# Define Template
app.clone("btn_buy,lbl_price,img_item")\
.on_base("card_bg")\
.id("product_item")\
.execute()
- .cols(n): Number of columns in the grid.
- .h(px) / .v(px): Horizontal/Vertical spacing.
- .scale(float): Resize clones (e.g., 0.8 for 80%).
# Create Grid
app.create_clone("product_item", "shop.grid_panel")\
.cols(3)\
.h(15).v(15)\
.scale(0.8)\
.execute()