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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tix/] [tests/] [general/] [labentry.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
# labentry.tcl --
2
#
3
#       Tests the TixLabelEntry widget.
4
#
5
# Copyright (c) 1996, Expert Interface Technologies
6
#
7
# See the file "license.terms" for information on usage and redistribution
8
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
9
#
10
 
11
proc About {} {
12
    return "Testing the TixLabelEntry widget"
13
}
14
 
15
proc Test {} {
16
    TestBlock labent-1.1 {LabelEntry focus management} {
17
        set t [toplevel .t]
18
 
19
        set w [tixLabelEntry .t.c -label "Stuff: "]
20
        pack $w -padx 20 -pady 10
21
        tixLabelEntry .t.d -label "Stuff: "
22
        pack .t.d -padx 20 -pady 10
23
        focus $w
24
        update
25
 
26
        set px [winfo pointerx $t]
27
        set py [winfo pointery $t]
28
        set W [winfo width $t]
29
        set H [winfo height $t]
30
 
31
        if {$W < 100} {
32
            set W 100
33
        }
34
        if {$H < 100} {
35
            set H 100
36
        }
37
 
38
        set mx [expr $px - $W / 2]
39
        set my [expr $py - $H / 2]
40
 
41
        # We must move the window under the cursor in order to test
42
        # the current focus
43
        #
44
        wm geometry $t $W\x$H+$mx+$my
45
        raise $t
46
        update
47
 
48
        Assert {[focus -lastfor $t] == [$w subwidget entry]}
49
 
50
        destroy $t
51
    }
52
}

powered by: WebSVN 2.1.0

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