----Next_Part(Wed_Jun_25_01:59:03_2003_920)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
±Ê°æ@Ãζ幩Âç¤Ç¤¹¡¥
Ĺ¤é¤¯ÃæÅÓȾü¤Ê¾õÂ֤ȤʤäƤ¤¤¿ Ruby/Tk ¤Î
resource database (option databese) ¥µ¥Ý¡¼¥È¤Ç¤¹¤¬¡¤
¤è¤¦¤ä¤¯¾¯¤·¤Ï»È¤¨¤ÊÄøÅ٤ˤʤê¤Þ¤·¤¿¡¥
Àè¤Û¤É commit ¤·¤Þ¤·¤¿¤Î¤Ç¡¤¤â¤·Îɤ«¤Ã¤¿¤é
CVS ¤«¤éÆþ¼ê¤·¤Æ»î¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡¥
Æþ¼êÁ°¤ËÊ·°Ïµ¤¤¬¤Ä¤«¤á¤ë¤è¤¦¤Ë¡¤ext/tk/samples ¤ËÄɲä·¤¿
¥µ¥ó¥×¥ë¥¹¥¯¥ê¥×¥È¤òꤍ¤Æ¤ª¤¤Þ¤¹¡¥
--
±Ê°æ ¨Â ¡Ê¶å¹©Âç ÃÎÊó¡Ë
nagai / ai.kyutech.ac.jp
----Next_Part(Wed_Jun_25_01:59:03_2003_920)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="tkoptdb.rb"
#!/usr/bin/env ruby
#
# sample script of TkOptionDB
#
# If 'LANG' environment variable's value is started by 'ja',
# then read Japanese resource data and display Japanese button text.
# In other case, read English resource data and display English text.
#
require "tk"
if ENV['LANG'] /^ja/
# read Japanese resource
TkOptionDB.readfile(File.expand_path('resource.ja', File.dirname(__FILE__)))
else
# read English resource
TkOptionDB.readfile(File.expand_path('resource.en', File.dirname(__FILE__)))
end
# 'show_msg' and 'bye_msg' procedures can be defined on BTN_CMD resource.
# Those procedures are called under $SAFE
cmd kOptionDB.new_proc_class(:BTN_CMD, [:show_msg, :bye_msg], 2) {
# If you want to check resource string (str),
# please define __check_proc_string__(str) like this.
class << self
def __check_proc_string__(str)
print "($SAFE $SAFE}) check!! str.tainted?::#{str.tainted?}"
str.untaint
print "