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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tix/] [tests/] [general/] [NoteBook.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 the notebook widgets"
3
}
4
 
5
proc NoteBookPageConfig {w pages} {
6
    foreach page $pages {
7
        Assert {"x[$w pagecget $page -label]" == "x$page"}
8
        Assert {"x[$w pageconfigure $page -label]" == "x-label {} {} {} $page"}
9
        $w pageconfigure $page -label foo
10
        Assert {"x[$w pagecget $page -label]" == "xfoo"}
11
        update
12
    }
13
}
14
 
15
proc Test {} {
16
    foreach class {tixListNoteBook tixNoteBook tixStackWindow} {
17
        set w [$class .d]
18
        pack $w
19
        update
20
 
21
        set pages {1 2 3 4 5 6 1111111112221}
22
 
23
        foreach page $pages {
24
            if {$class == "tixListNoteBook"} {
25
                $w subwidget hlist add $page -itemtype imagetext \
26
                    -image [tix getimage folder] -text $page
27
            }
28
            set p [$w add $page -label $page]
29
            for {set x 1} {$x < 10} {incr x} {
30
                button $p.$x -text $x
31
                pack $p.$x -fill x
32
            }
33
        }
34
 
35
        foreach page $pages {
36
            $w raise $page
37
            Assert {"x[$w raised]" == "x$page"}
38
            update
39
        }
40
 
41
        Assert {[string compare $pages [$w pages]] == 0}
42
 
43
        # test the "hooking" of the notebook frame subwidget
44
        #
45
        #
46
        if {$class == "tixNoteBook"} {
47
            NoteBookPageConfig $w $pages
48
        }
49
 
50
        foreach page $pages {
51
            Assert {"x[$w pagecget $page -raisecmd]" == "x"}
52
#           Assert {"x[$w pageconfigure $page -raisecmd]" == "x-raisecmd {} {} {} {}"}
53
            $w pageconfigure $page -raisecmd "RaiseCmd $page"
54
            Assert {"x[$w pagecget $page -raisecmd]" == "xRaiseCmd $page"}
55
            update
56
        }
57
 
58
        destroy $w
59
    }
60
}

powered by: WebSVN 2.1.0

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