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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tix/] [tests/] [general/] [optmenu.tcl] - Blame information for rev 1771

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

Line No. Rev Author Line
1 578 markom
proc About {} {
2
    return "Testing Option Menu widget"
3
}
4
 
5
proc Test {} {
6
    tixOptionMenu .p -label "From File Format : " -command "selectproc input" \
7
        -disablecallback 1 \
8
        -options {
9
            label.width 19
10
            label.anchor e
11
            menubutton.width 15
12
        }
13
 
14
    pack .p
15
 
16
    .p add command text   -label "Plain Text"
17
    .p add command post   -label "PostScript"
18
    .p add command format -label "Formatted Text"
19
    .p add command html   -label "HTML"
20
    .p add separator sep
21
    .p add command tex    -label "LaTeX"
22
    .p add command rtf    -label "Rich Text Format"
23
 
24
    update
25
 
26
    foreach ent [.p entries] {
27
        test {.p delete $ent}
28
    }
29
 
30
    Assert {[.p subwidget menubutton cget -text] == {}}
31
 
32
    test {destroy .p}
33
 
34
    # Testing deleting "sep" at the end
35
    #
36
    tixOptionMenu .p -label "From File Format : " -command "selectproc input" \
37
        -disablecallback 1 \
38
        -options {
39
            label.width 19
40
            label.anchor e
41
            menubutton.width 15
42
        }
43
 
44
 
45
    pack .p
46
 
47
    .p add command text   -label "Plain Text"
48
    .p add command post   -label "PostScript"
49
    .p add command format -label "Formatted Text"
50
    .p add command html   -label "HTML"
51
    .p add separator sep
52
    .p add command tex    -label "LaTeX"
53
    .p add command rtf    -label "Rich Text Format"
54
 
55
    test {.p delete text}
56
    test {.p delete post}
57
    test {.p delete html}
58
    test {.p delete format}
59
    test {.p delete tex}
60
    test {.p delete rtf}
61
    test {.p delete sep}
62
 
63
    Assert {[.p subwidget menubutton cget -text] == {}}
64
    test {destroy .p}
65
 
66
    # Testing deleting "sep" as the second-last one
67
    #
68
    tixOptionMenu .p -label "From File Format : " -command "selectproc input" \
69
        -disablecallback 1 \
70
        -options {
71
            label.width 19
72
            label.anchor e
73
            menubutton.width 15
74
        }
75
 
76
 
77
    pack .p
78
 
79
    .p add command text   -label "Plain Text"
80
    .p add command post   -label "PostScript"
81
    .p add command format -label "Formatted Text"
82
    .p add command html   -label "HTML"
83
    .p add separator sep
84
    .p add command tex    -label "LaTeX"
85
    .p add command rtf    -label "Rich Text Format"
86
 
87
    test {.p delete text}
88
    global .p
89
    Assert {[info exists .p(text,type)] == 0}
90
    Assert {[info exists .p(text,name)] == 0}
91
    Assert {[info exists .p(text,label)] == 0}
92
    test {.p delete post}
93
    test {.p delete html}
94
    test {.p delete format}
95
    test {.p delete tex}
96
 
97
    Assert {[.p cget -value] == "rtf"}
98
    test {.p delete sep}
99
    Assert {[.p cget -value] == "rtf"}
100
    test {.p delete rtf}
101
 
102
    Assert {[.p subwidget menubutton cget -text] == {}}
103
 
104
    test {destroy .p}
105
}

powered by: WebSVN 2.1.0

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