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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tix/] [demos/] [samples/] [CmpImg1.tcl] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# Tix Demostration Program
2
#
3
# This sample program is structured in such a way so that it can be
4
# executed from the Tix demo program "widget": it must have a
5
# procedure called "RunSample". It should also have the "if" statment
6
# at the end of this file so that it can be run as a standalone
7
# program using tixwish.
8
 
9
# This file demonstrates the use of the tixNoteBook widget, which allows
10
# you to lay out your interface using a "notebook" metaphore
11
#
12
 
13
proc RunSample {w} {
14
 
15
    # We use these options to set the sizes of the subwidgets inside the
16
    # notebook, so that they are well-aligned on the screen.
17
    #
18
    set name [tixOptionName $w]
19
    option add *$name*TixControl*entry.width 10
20
    option add *$name*TixControl*label.width 18
21
    option add *$name*TixControl*label.anchor e
22
    option add *$name*TixNoteBook*tabPadX 8
23
 
24
    # Create the notebook widget and set its backpagecolor to gray.
25
    # Note that the -backpagecolor option belongs to the "nbframe"
26
    # subwidget.
27
    tixNoteBook $w.nb -ipadx 6 -ipady 6
28
    $w config -bg gray
29
    $w.nb subwidget nbframe config -backpagecolor gray -tabpady 0
30
 
31
    # Create the two tabs on the notebook. The -underline option
32
    # puts a underline on the first character of the labels of the tabs.
33
    # Keyboard accelerators will be defined automatically according
34
    # to the underlined character.      
35
    #
36
    global network_pixmap hard_disk_pixmap
37
    set img0 [image create pixmap -data $network_pixmap]
38
    set img1 [image create pixmap -data $hard_disk_pixmap]
39
 
40
    set hd_img [image create compound -window [$w.nb subwidget nbframe]]
41
    $hd_img add line
42
    $hd_img add text -text "Hard Disk" -underline 0
43
    $hd_img add space -width 7
44
    $hd_img add image -image $img1
45
 
46
    $w.nb add hard_disk -image $hd_img
47
 
48
    set net_img [image create compound -window [$w.nb subwidget nbframe]]
49
    $net_img add line
50
    $net_img add text -text "Network" -underline 0
51
    $net_img add space -width 7
52
    $net_img add image -image $img0
53
 
54
    $w.nb add network  -image $net_img
55
    # Create the first page
56
    #
57
    set f [$w.nb subwidget hard_disk]
58
 
59
    tixControl $f.a -value 12   -label "Access Time: "
60
    tixControl $f.w -value 400  -label "Write Throughput: "
61
    tixControl $f.r -value 400  -label "Read Throughput: "
62
    tixControl $f.c -value 1021 -label "Capacity: "
63
    pack $f.a $f.w $f.r $f.c  -side top -padx 20 -pady 2
64
 
65
    # Create the second page    
66
    #
67
    set f [$w.nb subwidget network]
68
 
69
    tixControl $f.a -value 12   -label "Access Time: "
70
    tixControl $f.w -value 400  -label "Write Throughput: "
71
    tixControl $f.r -value 400  -label "Read Throughput: "
72
    tixControl $f.c -value 1021 -label "Capacity: "
73
    tixControl $f.u -value 10   -label "Users: "
74
 
75
    pack $f.a $f.w $f.r $f.c $f.u -side top -padx 20 -pady 2
76
    pack $w.nb -expand yes -fill both -padx 5 -pady 5
77
 
78
}
79
 
80
set network_pixmap {/* XPM */
81
static char * netw_xpm[] = {
82
/* width height ncolors chars_per_pixel */
83
"32 32 7 1",
84
/* colors */
85
"       s None  c None",
86
".      c #000000000000",
87
"X      c white",
88
"o      c #c000c000c000",
89
"O      c #404040",
90
"+      c blue",
91
"@      c red",
92
/* pixels */
93
"                                ",
94
"                 .............. ",
95
"                 .XXXXXXXXXXXX. ",
96
"                 .XooooooooooO. ",
97
"                 .Xo.......XoO. ",
98
"                 .Xo.++++o+XoO. ",
99
"                 .Xo.++++o+XoO. ",
100
"                 .Xo.++oo++XoO. ",
101
"                 .Xo.++++++XoO. ",
102
"                 .Xo.+o++++XoO. ",
103
"                 .Xo.++++++XoO. ",
104
"                 .Xo.XXXXXXXoO. ",
105
"                 .XooooooooooO. ",
106
"                 .Xo@ooo....oO. ",
107
" ..............  .XooooooooooO. ",
108
" .XXXXXXXXXXXX.  .XooooooooooO. ",
109
" .XooooooooooO.  .OOOOOOOOOOOO. ",
110
" .Xo.......XoO.  .............. ",
111
" .Xo.++++o+XoO.        @        ",
112
" .Xo.++++o+XoO.        @        ",
113
" .Xo.++oo++XoO.        @        ",
114
" .Xo.++++++XoO.        @        ",
115
" .Xo.+o++++XoO.        @        ",
116
" .Xo.++++++XoO.      .....      ",
117
" .Xo.XXXXXXXoO.      .XXX.      ",
118
" .XooooooooooO.@@@@@@.X O.      ",
119
" .Xo@ooo....oO.      .OOO.      ",
120
" .XooooooooooO.      .....      ",
121
" .XooooooooooO.                 ",
122
" .OOOOOOOOOOOO.                 ",
123
" ..............                 ",
124
"                                "};}
125
 
126
set hard_disk_pixmap {/* XPM */
127
static char * drivea_xpm[] = {
128
/* width height ncolors chars_per_pixel */
129
"32 32 5 1",
130
/* colors */
131
"       s None  c None",
132
".      c #000000000000",
133
"X      c white",
134
"o      c #c000c000c000",
135
"O      c #800080008000",
136
/* pixels */
137
"                                ",
138
"                                ",
139
"                                ",
140
"                                ",
141
"                                ",
142
"                                ",
143
"                                ",
144
"                                ",
145
"                                ",
146
"   ..........................   ",
147
"   .XXXXXXXXXXXXXXXXXXXXXXXo.   ",
148
"   .XooooooooooooooooooooooO.   ",
149
"   .Xooooooooooooooooo..oooO.   ",
150
"   .Xooooooooooooooooo..oooO.   ",
151
"   .XooooooooooooooooooooooO.   ",
152
"   .Xoooooooo.......oooooooO.   ",
153
"   .Xoo...................oO.   ",
154
"   .Xoooooooo.......oooooooO.   ",
155
"   .XooooooooooooooooooooooO.   ",
156
"   .XooooooooooooooooooooooO.   ",
157
"   .XooooooooooooooooooooooO.   ",
158
"   .XooooooooooooooooooooooO.   ",
159
"   .oOOOOOOOOOOOOOOOOOOOOOOO.   ",
160
"   ..........................   ",
161
"                                ",
162
"                                ",
163
"                                ",
164
"                                ",
165
"                                ",
166
"                                ",
167
"                                ",
168
"                                "};}
169
 
170
 
171
 
172
if {![info exists tix_demo_running]} {
173
    wm withdraw .
174
    set w .demo
175
    toplevel $w
176
    RunSample $w
177
    bind .demo <Destroy> exit
178
}

powered by: WebSVN 2.1.0

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