OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [itcl/] [iwidgets3.0.0/] [demos/] [toolbar] - Blame information for rev 1770

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
#!/bin/sh
2
# ----------------------------------------------------------------------
3
#  DEMO: toolbar in [incr Widgets]
4
# ----------------------------------------------------------------------
5
#\
6
exec itkwish "$0" ${1+"$@"}
7
package require Iwidgets 3.0
8
 
9
# itkwish interprets the rest...
10
# ----------------------------------------------------------------------
11
label .status -textvariable statusVar -width 40 -anchor w
12
pack .status -side bottom
13
 
14
iwidgets::toolbar .tb -helpvariable statusVar -orient vertical
15
pack .tb -side left -anchor nw -padx 4 -pady 4
16
 
17
set imagedir [file join ${iwidgets::library} demos images]
18
 
19
.tb add button select \
20
    -helpstr "Select drawing elements" \
21
    -image [image create photo -file [file join $imagedir select.gif]] \
22
    -balloonstr "Selection tool" \
23
    -command {puts "tool: select"}
24
 
25
.tb add button magnify \
26
    -helpstr "Magnify drawing area" \
27
    -image [image create photo -file [file join $imagedir mag.gif]] \
28
    -balloonstr "Zoom tool" \
29
    -command {puts "tool: magnify"}
30
 
31
.tb add button ruler \
32
    -helpstr "Measure distances on drawing" \
33
    -image [image create photo -file [file join $imagedir ruler.gif]] \
34
    -balloonstr "Ruler tool" \
35
    -command {puts "tool: ruler"}
36
 
37
.tb add frame filler \
38
    -borderwidth 1 \
39
    -width 10 \
40
    -height 10
41
 
42
.tb add button poly \
43
    -helpstr "Draw a polygon" \
44
    -image [image create photo -file [file join $imagedir poly.gif]] \
45
    -balloonstr "Polygon tool" \
46
    -command {puts "tool: polygon"}
47
 
48
canvas .worksp -width 2i -height 3i \
49
    -borderwidth 2 -relief sunken -background white
50
pack .worksp -side right -expand yes -fill both -padx 4 -pady 4

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.