Skip to content

Commit

Permalink
Add a button to open a dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
laffra committed Jan 13, 2024
1 parent 89ca5ab commit f6e162b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ def set_runtime(event):
if chosen != runtime:
window.setSearchParameter("runtime", chosen)

@ltk.callback
def open_dialog(event):
ltk.Div(
ltk.Text("This is a dialog")
).dialog()

widgets = [
ltk.VBox(
ltk.Text("Choose your favorite theme:"),
Expand Down Expand Up @@ -92,6 +98,8 @@ def set_runtime(event):
})
.on("keydown", key_down)
.on("change", change),
ltk.Button("Open Dialog", open_dialog),

]

def get_widgets():
Expand Down

0 comments on commit f6e162b

Please sign in to comment.