~ubuntu-branches/ubuntu/hardy/ruby1.8/hardy-updates

« back to all changes in this revision

Viewing changes to ext/tk/sample/tcltklib/lines0.tcl

  • Committer: Bazaar Package Importer
  • Author(s): akira yamada
  • Date: 2007-03-13 22:11:58 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070313221158-h3oql37brlaf2go2
Tags: 1.8.6-1
* new upstream version, 1.8.6.
* libruby1.8 conflicts with libopenssl-ruby1.8 (< 1.8.6) (closes: #410018)
* changed packaging style to cdbs from dbs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/local/bin/wish
 
2
 
 
3
proc drawlines {} {
 
4
    puts [clock format [clock seconds]]
 
5
 
 
6
    for {set j 0} {$j < 100} {incr j} {
 
7
        puts -nonewline "*"
 
8
        flush stdout
 
9
        if {$j & 1} {
 
10
            set c "blue"
 
11
        } {
 
12
            set c "red"
 
13
        }
 
14
        for {set i 0} {$i < 100} {incr i} {
 
15
#           .a create line $i 0 0 [expr 500 - $i] -fill $c
 
16
        }
 
17
    }
 
18
 
 
19
    puts [clock format [clock seconds]]
 
20
 
 
21
    for {set j 0} {$j < 100} {incr j} {
 
22
        puts -nonewline "*"
 
23
        flush stdout
 
24
        if {$j & 1} {
 
25
            set c "blue"
 
26
        } {
 
27
            set c "red"
 
28
        }
 
29
        for {set i 0} {$i < 100} {incr i} {
 
30
            .a create line $i 0 0 [expr 500 - $i] -fill $c
 
31
        }
 
32
    }
 
33
 
 
34
    puts [clock format [clock seconds]]
 
35
#    destroy .
 
36
}
 
37
 
 
38
canvas .a -height 500 -width 500
 
39
button .b -text draw -command drawlines
 
40
pack .a .b -side left
 
41
 
 
42
# eof