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

« back to all changes in this revision

Viewing changes to ext/tk/lib/tkextlib/tcllib/ruler.rb

  • 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
#
 
2
#  tkextlib/tcllib/ruler.rb
 
3
#                               by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
 
4
#
 
5
#   * Part of tcllib extension
 
6
#   * ruler widget
 
7
#
 
8
 
 
9
require 'tk'
 
10
require 'tkextlib/tcllib.rb'
 
11
 
 
12
# TkPackage.require('widget::ruler', '1.0')
 
13
TkPackage.require('widget::ruler')
 
14
 
 
15
module Tk::Tcllib
 
16
  module Widget
 
17
    class Ruler < TkWindow
 
18
      PACKAGE_NAME = 'widget::ruler'.freeze
 
19
      def self.package_name
 
20
        PACKAGE_NAME
 
21
      end
 
22
 
 
23
      def self.package_version
 
24
        begin
 
25
          TkPackage.require('widget::ruler')
 
26
        rescue
 
27
          ''
 
28
        end
 
29
      end
 
30
    end
 
31
  end
 
32
end
 
33
 
 
34
class Tk::Tcllib::Widget::Ruler
 
35
  TkCommandNames = ['::widget::ruler'.freeze].freeze
 
36
 
 
37
  def __boolval_optkeys
 
38
    ['showvalues', 'outline', 'grid']
 
39
  end
 
40
  private :__boolval_optkeys
 
41
 
 
42
  def __numlistval_optkeys
 
43
    ['interval', 'sizes']
 
44
  end
 
45
  private :__numlistval_optkeys
 
46
 
 
47
  def create_self(keys)
 
48
    if keys and keys != None
 
49
      tk_call_without_enc(self.class::TkCommandNames[0], @path, 
 
50
                          *hash_kv(keys, true))
 
51
    else
 
52
      tk_call_without_enc(self.class::TkCommandNames[0], @path)
 
53
    end
 
54
  end
 
55
  private :create_self
 
56
 
 
57
  def redraw
 
58
    tk_send('redraw')
 
59
    self
 
60
  end
 
61
 
 
62
  def shade(org, dest, frac)
 
63
    tk_send('shade', org, dest, frac)
 
64
  end
 
65
end