~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to ext/tk/sample/demos-en/square

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env ruby
2
2
 
3
3
# square --
4
 
# This script generates a demo application containing only 
5
 
# a "square" widget.  It's only usable if Tk has been compiled 
6
 
# with tkSquare.c and with the -DSQUARE_DEMO compiler switch. 
7
 
# This demo arranges the following bindings for the widget: 
 
4
# This script generates a demo application containing only
 
5
# a "square" widget.  It's only usable if Tk has been compiled
 
6
# with tkSquare.c and with the -DSQUARE_DEMO compiler switch.
 
7
# This demo arranges the following bindings for the widget:
8
8
#
9
9
# Button-1 press/drag:          moves square to mouse
10
10
# "a":                          toggle size animation on/off
19
19
      tk_call 'square', path
20
20
    rescue
21
21
      STDERR.print "\nSorry. Your Tk interpreter does not contain " +
22
 
        'a "square" demonstration widget.' + 
 
22
        'a "square" demonstration widget.' +
23
23
        "\n ( See documents included the Tcl/Tk source archive. )\n\n"
24
24
      exit
25
25
    end
53
53
end
54
54
 
55
55
# The procedures below provide a simple form of animation where
56
 
# the box changes size in a pulsing pattern: larger, smaller, larger, 
 
56
# the box changes size in a pulsing pattern: larger, smaller, larger,
57
57
# and so on.
58
58
 
59
59
$inc = 0