diff --git a/README.md b/README.md index 13c2403..482f8fb 100644 --- a/README.md +++ b/README.md @@ -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, "", callback) ## press return key when button has focus ```