ruby/ext/tk/lib/tkextlib/tile/tentry.rb
nagai 20b20bb72a * ext/tk/tcltklib.c, ext/tk/tkutil/tkutil.c: fix memory leak.
* ext/tk/lib/tk.rb: avoid trouble when finalize TclTkIp.

* ext/tk/lib/tk.rb, ext/tk/lib/tk/*: help to fix troubles when 
  use Ttk widgets on old Tk scripts.

* ext/tk/sample/*: update and add demo stcipts. some of them are 
  introduction about new features of Tcl/Tk8.5.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-22 19:24:24 +00:00

48 lines
983 B
Ruby

#
# tentry widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
#
require 'tk'
require 'tkextlib/tile.rb'
module Tk
module Tile
class TEntry < Tk::Entry
end
Entry = TEntry
end
end
Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Entry, :TkEntry)
class Tk::Tile::TEntry < Tk::Entry
include Tk::Tile::TileWidget
if Tk::Tile::USE_TTK_NAMESPACE
TkCommandNames = ['::ttk::entry'.freeze].freeze
else
TkCommandNames = ['::tentry'.freeze].freeze
end
WidgetClassName = 'TEntry'.freeze
WidgetClassNames[WidgetClassName] = self
def __optkey_aliases
{:vcmd=>:validatecommand, :invcmd=>:invalidcommand}
end
private :__optkey_aliases
def __boolval_optkeys
super() << 'exportselection'
end
private :__boolval_optkeys
def __strval_optkeys
super() << 'show'
end
private :__strval_optkeys
def self.style(*args)
[self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
end
end