Alpha_1 Tk Interface Manual


a1wish Program

The a1wish program allows Tcl/Tk scripts to use the a1canvas widget. It is the basic Tk wish script with the addition of the a1canvas as well as [incr Tcl]. It can be used in 2 ways: interactively or through a Tcl/Tk script.

Interactive Use

An interactive a1wish session will generally be of this form:
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:

Script Usage

Generally, a1wish will be used to run user defined Tcl/Tk scripts that have incorporated the a1canvas widget. This is accomplished by placing the tcl code into a file and passing it to the a1wish program on the command line:
a1wish gui.tcl
If 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.


Alpha_1 Tk Interface Overview
Alpha_1 Programmer's Manual. Version 95.06.
Copyright © 1995, University of Utah