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

« back to all changes in this revision

Viewing changes to ext/tk/lib/tkextlib/bwidget/labelentry.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/bwidget/labelentry.rb
 
3
#                               by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
 
4
#
 
5
 
 
6
require 'tk'
 
7
require 'tk/entry'
 
8
require 'tkextlib/bwidget.rb'
 
9
require 'tkextlib/bwidget/labelframe'
 
10
require 'tkextlib/bwidget/entry'
 
11
 
 
12
module Tk
 
13
  module BWidget
 
14
    class LabelEntry < TkEntry
 
15
    end
 
16
  end
 
17
end
 
18
 
 
19
class Tk::BWidget::LabelEntry
 
20
  include Scrollable
 
21
 
 
22
  TkCommandNames = ['LabelEntry'.freeze].freeze
 
23
  WidgetClassName = 'LabelEntry'.freeze
 
24
  WidgetClassNames[WidgetClassName] = self
 
25
 
 
26
  def __strval_optkeys
 
27
    super() << 'helptext' << 'insertbackground' << 'entryfg' << 'entrybg'
 
28
  end
 
29
  private :__strval_optkeys
 
30
 
 
31
  def __tkvariable_optkeys
 
32
    super() << 'helpvar'
 
33
  end
 
34
  private :__tkvariable_optkeys
 
35
 
 
36
  def __font_optkeys
 
37
    super() << 'labelfont'
 
38
  end
 
39
  private :__font_optkeys
 
40
 
 
41
  #def entrybind(*args)
 
42
  #  _bind([path, 'bind'], *args)
 
43
  #  self
 
44
  #end
 
45
  def entrybind(context, *args)
 
46
    # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
 
47
    if TkComm._callback_entry?(args[0]) || !block_given?
 
48
      cmd = args.shift
 
49
    else
 
50
      cmd = Proc.new
 
51
    end
 
52
    _bind([path, 'bind'], context, cmd, *args)
 
53
    self
 
54
  end
 
55
 
 
56
  #def entrybind_append(*args)
 
57
  #  _bind_append([path, 'bind'], *args)
 
58
  #  self
 
59
  #end
 
60
  def entrybind_append(context, *args)
 
61
    #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
 
62
    if TkComm._callback_entry?(args[0]) || !block_given?
 
63
      cmd = args.shift
 
64
    else
 
65
      cmd = Proc.new
 
66
    end
 
67
    _bind_append([path, 'bind'], context, cmd, *args)
 
68
    self
 
69
  end
 
70
 
 
71
  def entrybind_remove(*args)
 
72
    _bind_remove([path, 'bind'], *args)
 
73
    self
 
74
  end
 
75
 
 
76
  def entrybindinfo(*args)
 
77
    _bindinfo([path, 'bind'], *args)
 
78
    self
 
79
  end
 
80
end