real : ~> a1wish % % button .b -text "My Button" .b % pack .b % a1canvas .c -bg Black .c % pack .c % a1_file .c read u_logo.a1 % dl_viewing .c view center %Which produces the output:
a1wish gui.tclIf the contents of gui.tcl were the following:
frame .f button .q -text "Quit" -command exit button .b -text "Press Me!" -command {puts "Ouch! Not so hard!"} button .d -text "File" -command {a1_file .c read ../view/u_logo.a1} button .e -text "Center" -command {dl_viewing .c view center} pack .q .b .d .e -in .f -side left pack .f -fill x a1canvas .c pack .c dl_viewing .c curr_view_mode xy_rotate .c configure -bg Black bind .c <Button2-Motion> {dl_viewing .c motion %x %y} bind .c <ButtonPress-2> {dl_viewing .c pointerdown %x %y} bind .c <ButtonRelease-2> {dl_viewing .c pointerup %x %y}the following program that allows the user to rotate the u_logo with mouse button 2 would be produced.