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

« back to all changes in this revision

Viewing changes to ext/tk/lib/tkextlib/tile/tcombobox.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
#  tcombobox widget
 
3
#                               by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
 
4
#
 
5
require 'tk'
 
6
require 'tkextlib/tile.rb'
 
7
 
 
8
module Tk
 
9
  module Tile
 
10
    class TCombobox < Tk::Tile::TEntry
 
11
    end
 
12
    Combobox = TCombobox
 
13
  end
 
14
end
 
15
 
 
16
class Tk::Tile::TCombobox < Tk::Tile::TEntry
 
17
  include Tk::Tile::TileWidget
 
18
 
 
19
  if Tk::Tile::USE_TTK_NAMESPACE
 
20
    TkCommandNames = ['::ttk::combobox'.freeze].freeze
 
21
  else
 
22
    TkCommandNames = ['::tcombobox'.freeze].freeze
 
23
  end
 
24
  WidgetClassName = 'TCombobox'.freeze
 
25
  WidgetClassNames[WidgetClassName] = self
 
26
 
 
27
  def __boolval_optkeys
 
28
    super() << 'exportselection'
 
29
  end
 
30
  private :__boolval_optkeys
 
31
 
 
32
  def __listval_optkeys
 
33
    super() << 'values'
 
34
  end
 
35
  private :__listval_optkeys
 
36
 
 
37
  def self.style(*args)
 
38
    [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
 
39
  end
 
40
 
 
41
  def current
 
42
    number(tk_send_without_enc('current'))
 
43
  end
 
44
  def current=(idx)
 
45
    tk_send_without_enc('current', idx)
 
46
  end
 
47
 
 
48
  def set(val)
 
49
    tk_send('set', val)
 
50
  end
 
51
end