1 | # ---------------------------------------------------------------------- |
---|
2 | # COMPONENT: testview - display the results of a test |
---|
3 | # |
---|
4 | # Doesn't do anything yet. TODO: Fill this in later. |
---|
5 | # ====================================================================== |
---|
6 | # AUTHOR: Ben Rafferty, Purdue University |
---|
7 | # Copyright (c) 2010 Purdue Research Foundation |
---|
8 | # |
---|
9 | # See the file "license.terms" for information on usage and |
---|
10 | # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
11 | # ====================================================================== |
---|
12 | package require Itk |
---|
13 | |
---|
14 | namespace eval Rappture::Regression::TestView { #forward declaration } |
---|
15 | |
---|
16 | itcl::class Rappture::Regression::TestView { |
---|
17 | inherit itk::Widget |
---|
18 | |
---|
19 | public method showDefault {} |
---|
20 | public method showText {text} |
---|
21 | |
---|
22 | constructor {args} { #defined later } |
---|
23 | } |
---|
24 | |
---|
25 | # ---------------------------------------------------------------------- |
---|
26 | # CONSTRUCTOR |
---|
27 | # ---------------------------------------------------------------------- |
---|
28 | itcl::body Rappture::Regression::TestView::constructor {args} { |
---|
29 | itk_component add txt { |
---|
30 | text $itk_interior.txt |
---|
31 | } |
---|
32 | pack $itk_component(txt) -expand yes -fill both |
---|
33 | showDefault |
---|
34 | |
---|
35 | eval itk_initialize $args |
---|
36 | } |
---|
37 | |
---|
38 | itk::usual TestView { |
---|
39 | keep -background -foreground -font |
---|
40 | } |
---|
41 | |
---|
42 | itcl::body Rappture::Regression::TestView::showDefault {} { |
---|
43 | $itk_component(txt) configure -state normal |
---|
44 | $itk_component(txt) delete 0.0 end |
---|
45 | $itk_component(txt) insert end "Default" |
---|
46 | $itk_component(txt) configure -state disabled |
---|
47 | } |
---|
48 | |
---|
49 | itcl::body Rappture::Regression::TestView::showText {text} { |
---|
50 | $itk_component(txt) configure -state normal |
---|
51 | $itk_component(txt) delete 0.0 end |
---|
52 | $itk_component(txt) insert end "$text" |
---|
53 | $itk_component(txt) configure -state disabled |
---|
54 | } |
---|