Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ViralBShah authored Aug 12, 2024
1 parent 795a889 commit 717e39c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@
# A simple example

```julia
w = Toplevel("Example") ## A titled top level window
f = Frame(w, padding = [3,3,2,2], relief="groove") ## A Frame with some options set
pack(f, expand = true, fill = "both") ## using pack to manage the layout of f
using Tk

b = Button(f, "Click for a message") ## Button constructor has convenience interface
grid(b, 1, 1) ## use grid to pack in b. 1,1 specifies location
w = Toplevel("Example") ## A titled top level window
f = Frame(w, padding = [3,3,2,2], relief="groove") ## A Frame with some options set
pack(f, expand = true, fill = "both") ## using pack to manage the layout of f

callback(path) = Messagebox(w, title="A message", message="Hello World") ## A callback to open a message
b = Button(f, "Click for a message") ## Button constructor has convenience interface
grid(b, 1, 1) ## use grid to pack in b. 1,1 specifies location

## A callback to open a message
callback(path) = Messagebox(w, title="A message", message="Hello World")
bind(b, "command", callback) ## bind callback to 'command' option
bind(b, "<Return>", callback) ## press return key when button has focus
```

0 comments on commit 717e39c

Please sign in to comment.