2
# tkextlib/tcllib/ip_entry.rb
3
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
5
# * Part of tcllib extension
6
# * An IP address entry widget
8
# (The following is the original description of the library.)
10
# This package provides a widget for the entering of a IP address.
11
# It guarantees a valid address at all times.
14
require 'tkextlib/tcllib.rb'
16
# TkPackage.require('ipentry', '0.1')
17
TkPackage.require('ipentry')
21
class IP_Entry < TkEntry
22
PACKAGE_NAME = 'ipentry'.freeze
27
def self.package_version
29
TkPackage.require('ipentry')
39
class Tk::Tcllib::IP_Entry
40
TkCommandNames = ['::ipentry::ipentry'.freeze].freeze
41
WidgetClassName = 'IPEntry'.freeze
42
WidgetClassNames[WidgetClassName] = self
45
if keys and keys != None
46
tk_call_without_enc(self.class::TkCommandNames[0], @path,
49
tk_call_without_enc(self.class::TkCommandNames[0], @path)
55
super() << 'fg' << 'bg' << 'insertbackground'
57
private :__strval_optkeys
60
bool(tk_send_without_enc('complete'))
64
tk_send_without_enc('insert', array2tk_list(ip.flatten))