code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
#
# animated label widget demo (called by 'widget')
#
# based on Tcl/Tk8.5a2 widget demos
if defined?($anilabel_demo) && $anilabel_demo
$anilabel_demo.destroy
$anilabel_demo = nil
end
# demo toplevel widget
$anilabel_demo = TkToplevel.new {|w|
title("Animated Label Demonstration")
iconname("anilabel")
posi... | Ruby |
#
# text widget peering demo (called by 'widget')
#
# based on Tcl/Tk8.5.0 widget demos
if defined?($textpeer_demo) && $textpeer_demo
$textpeer_demo.destroy
$textpeer_demo = nil
end
# demo toplevel widget
$textpeer_demo = TkToplevel.new {|w|
title("Text Wdget Peering Demonstration")
iconname("textpeer")
po... | Ruby |
require "tkcanvas"
if defined?($hscale_demo) && $hscale_demo
$hscale_demo.destroy
$hscale_demo = nil
end
$hscale_demo = TkToplevel.new {|w|
title("Horizontal Scale Demonstration")
iconname("hscale")
}
positionWindow($hscale_demo)
base_frame = TkFrame.new($hscale_demo).pack(:fill=>:both, :expand=>true)
msg =... | Ruby |
# image2.rb
#
# This demonstration script creates a simple collection of widgets
# that allow you to select and view images in a Tk label.
#
# widget demo 'load image' (called by 'widget')
#
# toplevel widget
if defined?($image2_demo) && $image2_demo
$image2_demo.destroy
$image2_demo = nil
end
# demo toplevel wi... | Ruby |
#!/usr/bin/env ruby
require 'remote-tk'
puts <<EOM
This sample controls the other Tk interpreter (Ruby/Tk, Tcl/Tk, and so on)
which running on the other process. For this purpose, Ruby/Tk uses Tcl/Tk's
'send' command. Availability of the command depends on your GUI environment.
If this script doesn't work, please ch... | Ruby |
#!/usr/bin/env ruby
require 'tk'
class Clock
def initialize(clock24 = true)
@clock = (clock24)? 24: 12
@size = 200
@cdot_size = 5
@cdot_color = 'black'
@hour_hand_color = 'black'
@minute_hand_color = 'gray25'
@second_hand_color = 'gray50'
@mark_font = 'Helvetica -14'
... | Ruby |
# extconf.rb for tcltklib
require 'mkmf'
is_win32 = (/mswin|mingw|cygwin|bccwin/ =~ RUBY_PLATFORM)
#is_macosx = (/darwin/ =~ RUBY_PLATFORM)
have_func("ruby_native_thread_p", "ruby.h")
have_func("rb_errinfo", "ruby.h")
have_func("rb_safe_level", "ruby.h")
have_struct_member("struct RArray", "ptr", "ruby.h")
have_stru... | Ruby |
begin
has_tk = compiled?('tk')
rescue NoMethodError
# Probably, called manually (NOT from 'extmk.rb'). Force to make Makefile.
has_tk = true
end
if has_tk
require 'mkmf'
have_func("rb_obj_instance_exec", "ruby.h")
have_func("strndup", "string.h")
create_makefile('tkutil')
end
| Ruby |
#
# tkmenubar.rb - load tk/menubar.rb
#
require 'tk/menubar'
| Ruby |
#
# tkpalette.rb - load tk/palette.rb
#
require 'tk/palette'
| Ruby |
#
# tkclass.rb - Tk classes
# Date: 2000/11/27 09:23:36
# by Yukihiro Matsumoto <matz@caelum.co.jp>
#
# $Id: tkclass.rb 11708 2007-02-12 23:01:19Z shyouhei $
require "tk"
TopLevel = TkToplevel
Frame = TkFrame
Label = TkLabel
Button = TkBu... | Ruby |
#
# tkmacpkg.rb - load tk/macpkg.rb
#
require 'tk/macpkg'
| Ruby |
#
# tkafter.rb - load tk/after.rb
#
require 'tk/timer'
| Ruby |
#
# tkdialog.rb - load tk/dialog.rb
#
require 'tk/dialog'
| Ruby |
#
# tkvirtevent.rb - load tk/virtevent.rb
#
require 'tk/virtevent'
| Ruby |
#
# tktext.rb - load tk/text.rb
#
require 'tk/text'
| Ruby |
#
# tkcanvas.rb - load tk/canvas.rb
#
require 'tk/canvas'
| Ruby |
#
# tkscrollbox.rb - load tk/scrollbox.rb
#
require 'tk/scrollbox'
| Ruby |
#
# tk.rb - Tk interface module using tcltklib
# by Yukihiro Matsumoto <matz@netlab.jp>
# use Shigehiro's tcltklib
require 'tcltklib'
require 'tkutil'
# autoload
require 'tk/autoload'
# for Mutex
require 'thread'
class TclTkIp
# backup original (without encoding) _eval and _inv... | Ruby |
#
# tkwinpkg.rb - load tk/winpkg.rb
#
require 'tk/winpkg'
| Ruby |
#
# multi-tk.rb - supports multi Tk interpreters
# by Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
require 'tcltklib'
require 'tkutil'
require 'thread'
if defined? Tk
fail RuntimeError,"'multi-tk' library must be required before requiring 'tk'"
end
##################################... | Ruby |
#
# tk/canvastag.rb - methods for treating canvas tags
#
require 'tk'
require 'tk/tagfont'
module TkcTagAccess
include TkComm
include TkTreatTagFont
end
require 'tk/canvas'
module TkcTagAccess
def addtag(tag)
@c.addtag(tag, 'withtag', @id)
self
end
def bbox
@c.bbox(@id)
end
#def bind(seq,... | Ruby |
#
# tk/winfo.rb : methods for winfo command
#
module TkWinfo
end
require 'tk'
module TkWinfo
include Tk
extend Tk
TkCommandNames = ['winfo'.freeze].freeze
def TkWinfo.atom(name, win=nil)
if win
number(tk_call_without_enc('winfo', 'atom', '-displayof', win,
_get_ev... | Ruby |
#
# tk/msgcat.rb : methods for Tcl message catalog
# by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
#
require 'tk'
#class TkMsgCatalog
class TkMsgCatalog < TkObject
include TkCore
extend Tk
#extend TkMsgCatalog
TkCommandNames = [
'::msgcat::mc'.freeze,
'::msgcat::mcmax'.freeze,
... | Ruby |
#
# tk/selection.rb : control selection
#
require 'tk'
module TkSelection
include Tk
extend Tk
TkCommandNames = ['selection'.freeze].freeze
def self.clear(sel=nil)
if sel
tk_call_without_enc('selection', 'clear', '-selection', sel)
else
tk_call_without_enc('selection', 'clear')
end
... | Ruby |
#
# tk/text.rb - Tk text classes
# by Yukihiro Matsumoto <matz@caelum.co.jp>
require 'tk'
require 'tk/itemfont'
require 'tk/itemconfig'
require 'tk/scrollable'
require 'tk/txtwin_abst'
module TkTextTagConfig
include TkTreatItemFont
include TkItemConfigMethod
def __item_cget_c... | Ruby |
#
# tk/message.rb : treat message widget
#
require 'tk'
require 'tk/label'
class Tk::Message<Tk::Label
TkCommandNames = ['message'.freeze].freeze
WidgetClassName = 'Message'.freeze
WidgetClassNames[WidgetClassName] = self
#def create_self(keys)
# if keys and keys != None
# tk_call_without_enc('message'... | Ruby |
#
# tk/xim.rb : control imput_method
#
require 'tk'
module TkXIM
include Tk
extend Tk
TkCommandNames = ['imconfigure'.freeze].freeze
def TkXIM.useinputmethods(value = None, win = nil)
if value == None
if win
bool(tk_call_without_enc('tk', 'useinputmethods',
... | Ruby |
#
# tk/image.rb : treat Tk image objects
#
require 'tk'
class TkImage<TkObject
include Tk
TkCommandNames = ['image'.freeze].freeze
Tk_IMGTBL = TkCore::INTERP.create_table
(Tk_Image_ID = ['i'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
}
TkCore::I... | Ruby |
#
# tk/event.rb - module for event
#
module TkEvent
end
########################
require 'tkutil'
require 'tk'
########################
module TkEvent
class Event < TkUtil::CallbackSubst
module Grp
KEY = 0x1
BUTTON = 0x2
MOTION = 0x4
CR... | Ruby |
#
# tk/after.rb : methods for Tcl/Tk after command
#
# $Id: after.rb 11708 2007-02-12 23:01:19Z shyouhei $
#
require 'tk/timer'
| Ruby |
#
# tk/clock.rb : methods for clock command
#
require 'tk'
module Tk
module Clock
include Tk
extend TkCore
def self.add(clk, *args)
tk_call_without_enc('clock','add', clk, *args).to_i
end
def self.clicks(ms=nil)
ms = ms.to_s if ms.kind_of?(Symbol)
case ms
when nil, ''
... | Ruby |
#
# tk/wm.rb : methods for wm command
#
require 'tk'
module Tk
module Wm
#include TkComm
extend TkCore
TkCommandNames = ['wm'.freeze].freeze
TOPLEVEL_METHODCALL_OPTKEYS = {}
def Wm.aspect(win, *args)
if args.length == 0
list(tk_call_without_enc('wm', 'aspect', win.epath))
e... | Ruby |
#
# tk/tagfont.rb : control font of tags
#
require 'tk'
module TkTreatTagFont
def font_configinfo
@parent.tagfont_configinfo(@id)
end
# alias font font_configinfo
def font_configure(slot)
@parent.tagfont_configure(@id, slot)
self
end
def latinfont_configure(ltn, keys=nil)
@parent.latintagf... | Ruby |
#
# tk/textwindow.rb - treat Tk text window object
#
require 'tk'
require 'tk/text'
class TkTextWindow<TkObject
include Tk::Text::IndexModMethods
def initialize(parent, index, keys = {})
#unless parent.kind_of?(Tk::Text)
# fail ArgumentError, "expect Tk::Text for 1st argument"
#end
@t = parent
... | Ruby |
#
# tk/timer.rb : methods for Tcl/Tk after command
#
# $Id: timer.rb 16020 2008-04-14 15:17:52Z nagai $
#
require 'tk'
class TkTimer
include TkCore
extend TkCore
TkCommandNames = ['after'.freeze].freeze
(Tk_CBID = ['a'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; e... | Ruby |
#
# tk/root.rb : treat root widget
#
require 'tk'
require 'tk/wm'
require 'tk/menuspec'
class Tk::Root<TkWindow
include Wm
include TkMenuSpec
def __methodcall_optkeys # { key=>method, ... }
TOPLEVEL_METHODCALL_OPTKEYS
end
private :__methodcall_optkeys
def Root.new(keys=nil, &b)
unless TkCore::IN... | Ruby |
#
# tk/label.rb : treat label widget
#
require 'tk'
class Tk::Label<TkWindow
TkCommandNames = ['label'.freeze].freeze
WidgetClassName = 'Label'.freeze
WidgetClassNames[WidgetClassName] = self
#def create_self(keys)
# if keys and keys != None
# tk_call_without_enc('label', @path, *hash_kv(keys, true))
... | Ruby |
#
# tk/place.rb : control place geometry manager
#
require 'tk'
module TkPlace
include Tk
extend Tk
TkCommandNames = ['place'.freeze].freeze
def configure(win, slot, value=None)
# for >= Tk8.4a2 ?
# win = win.epath if win.kind_of?(TkObject)
win = _epath(win)
if slot.kind_of? Hash
params... | Ruby |
#
# tk/txtwin_abst.rb : TkTextWin abstruct class
#
require 'tk'
class TkTextWin<TkWindow
TkCommandNames = [].freeze
#def create_self
# fail RuntimeError, "TkTextWin is an abstract class"
#end
#private :create_self
def bbox(index)
list(tk_send_without_enc('bbox', index))
end
def delete(first, last... | Ruby |
#
# tk/composite.rb :
#
require 'tk'
module TkComposite
include Tk
extend Tk
=begin
def initialize(parent=nil, *args)
@delegates = {}
@option_methods = {}
@option_setting = {}
if parent.kind_of? Hash
keys = _symbolkey2str(parent)
parent = keys.delete('parent')
@frame = TkFram... | Ruby |
#
# tk/optiondb.rb : treat option database
#
require 'tk'
module TkOptionDB
include Tk
extend Tk
TkCommandNames = ['option'.freeze].freeze
(CmdClassID = ['CMD_CLASS'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
}
module Priority
WidgetDefault = 2... | Ruby |
#
# tk/textimage.rb - treat Tk text image object
#
require 'tk'
require 'tk/text'
class TkTextImage<TkObject
include Tk::Text::IndexModMethods
def initialize(parent, index, keys)
#unless parent.kind_of?(Tk::Text)
# fail ArgumentError, "expect Tk::Text for 1st argument"
#end
@t = parent
if ind... | Ruby |
#
# tk/dialog.rb : create dialog boxes
#
require 'tk'
require 'tk/variable.rb'
class TkDialogObj < TkWindow
extend Tk
TkCommandNames = ['tk_dialog'.freeze].freeze
def self.show(*args)
dlog = self.new(*args)
dlog.show
dlog
end
def _set_button_config(configs)
set_config = proc{|c,i|
... | Ruby |
#
# ttk_selector
#
######################################
# toplevel classes/modules
module Tk
@TOPLEVEL_ALIAS_TABLE[:Ttk] = {
:TkButton => 'tkextlib/tile/tbutton',
:TkCheckbutton => 'tkextlib/tile/tcheckbutton',
:TkCheckButton => 'tkextlib/tile/tcheckbutton',
# :TkDialog => 'tkex... | Ruby |
#
# tk/virtevent.rb : treats virtual events
# 1998/07/16 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
#
require 'tk'
class TkVirtualEvent<TkObject
extend Tk
TkCommandNames = ['event'.freeze].freeze
(TkVirtualEventID = ["VirtEvent".freeze, "00000".taint]).instance_eval{
@mutex = Mutex.n... | Ruby |
#
# tk/optionobj.rb : control options for a group of widgets
#
# NOTE: If you want to use key-only option (no value),
# use Tk::None for the value of the key-only option.
#
# e.g. hash_kv({'aaa'=>1, 'bbb'=>Tk::None, 'ccc'=>3})
# => ["-aaa", 1, "-bbb", "-ccc", 3]
#
require 'tk'
module ... | Ruby |
#
# tk/frame.rb : treat frame widget
#
require 'tk'
class Tk::Frame<TkWindow
TkCommandNames = ['frame'.freeze].freeze
WidgetClassName = 'Frame'.freeze
WidgetClassNames[WidgetClassName] = self
################# old version
# def initialize(parent=nil, keys=nil)
# if keys.kind_of? Hash
# keys = keys.dup
... | Ruby |
#
# tk/mngfocus.rb : methods for Tcl/Tk standard library 'focus.tcl'
# by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
#
require 'tk'
module TkManageFocus
extend Tk
TkCommandNames = [
'tk_focusFollowMouse'.freeze,
'tk_focusNext'.freeze,
'tk_focusPrev'.freeze
].freeze
def... | Ruby |
#
# tk/pack.rb : control pack geometry manager
#
require 'tk'
module TkPack
include Tk
extend Tk
TkCommandNames = ['pack'.freeze].freeze
=begin
def configure(win, *args)
if args[-1].kind_of?(Hash)
opts = args.pop
else
opts = {}
end
params = []
# params.push((win.kind_of?(TkObj... | Ruby |
#
# tk/font.rb - the class to treat fonts on Ruby/Tk
#
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
#
require 'tk'
class TkFont
include Tk
extend TkCore
TkCommandNames = ['font'.freeze].freeze
(Tk_FontID = ["@font".freeze, "00000".taint]).instance_eval{
@mutex = Mutex.new... | Ruby |
#
# tk/scrollable.rb : module for scrollable widget
#
require 'tk'
module Tk
module XScrollable
def xscrollcommand(cmd=Proc.new)
configure_cmd 'xscrollcommand', cmd
# Tk.update # avoid scrollbar trouble
self
end
def xview(*index)
if index.size == 0
list(tk_send_without_e... | Ruby |
#
# tk/kinput.rb : control kinput
#
require 'tk'
module TkKinput
include Tk
extend Tk
TkCommandNames = [
'kinput_start'.freeze,
'kinput_send_spot'.freeze,
'kanjiInput'.freeze
].freeze
def TkKinput.start(win, style=None)
tk_call('kinput_start', win, style)
end
def kinput_start(style=No... | Ruby |
#
# tk/grid.rb : control grid geometry manager
#
require 'tk'
module TkGrid
include Tk
extend Tk
TkCommandNames = ['grid'.freeze].freeze
def anchor(master, anchor=None)
# master = master.epath if master.kind_of?(TkObject)
master = _epath(master)
tk_call_without_enc('grid', 'anchor', master, ancho... | Ruby |
#
# tk/radiobutton.rb : treat radiobutton widget
#
require 'tk'
require 'tk/button'
class Tk::RadioButton<Tk::Button
TkCommandNames = ['radiobutton'.freeze].freeze
WidgetClassName = 'Radiobutton'.freeze
WidgetClassNames[WidgetClassName] = self
#def create_self(keys)
# if keys and keys != None
# tk_call... | Ruby |
#
# tk/spinbox.rb - Tk spinbox classes
# by Yukihiro Matsumoto <matz@caelum.co.jp>
#
require 'tk'
require 'tk/entry'
class Tk::Spinbox<Tk::Entry
TkCommandNames = ['spinbox'.freeze].freeze
WidgetClassName = 'Spinbox'.freeze
WidgetClassNames[WidgetClassName] = self
class Spin... | Ruby |
#
# tk/winpkg.rb : methods for Tcl/Tk packages for Microsoft Windows
# 2000/11/22 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
#
# ATTENTION !!
# This is NOT TESTED. Because I have no test-environment.
#
require 'tk'
module Tk::WinDDE
end
#TkWinDDE = Tk::WinDDE
Tk.__set_toplevel_aliase... | Ruby |
#
# tkbgerror -- bgerror ( tkerror ) module
# 1998/07/16 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
#
require 'tk'
module TkBgError
extend Tk
TkCommandNames = ['bgerror'.freeze].freeze
def bgerror(message)
tk_call('bgerror', message)
end
alias tkerror bgerror
alias show bgerror
... | Ruby |
#
# tk/button.rb : treat button widget
#
require 'tk'
require 'tk/label'
class Tk::Button<Tk::Label
TkCommandNames = ['button'.freeze].freeze
WidgetClassName = 'Button'.freeze
WidgetClassNames[WidgetClassName] = self
#def create_self(keys)
# if keys and keys != None
# tk_call_without_enc('button', @pat... | Ruby |
#
# tk/menuspec.rb
# Hidethoshi NAGAI (nagai@ai.kyutech.ac.jp)
#
# based on tkmenubar.rb :
# Copyright (C) 1998 maeda shugo. All rights reserved.
# This file can be distributed under the terms of the Ruby.
#
# The format of the menu_spec is:
# [ menu_info, menu_info, ... ]
#
# And th... | Ruby |
#
# tk/validation.rb - validation support module for entry, spinbox, and so on
#
require 'tk'
module Tk
module ValidateConfigure
def self.__def_validcmd(scope, klass, keys=nil)
keys = klass._config_keys unless keys
keys.each{|key|
eval("def #{key}(*args, &b)
__validcmd_call(... | Ruby |
#
# autoload
#
############################################
# geometry manager
module Tk
autoload :Grid, 'tk/grid'
def Grid(*args); TkGrid.configure(*args); end
autoload :Pack, 'tk/pack'
def Pack(*args); TkPack.configure(*args); end
autoload :Place, 'tk/place'
def Plac... | Ruby |
#
# tk/namespace.rb : methods to manipulate Tcl/Tk namespace
# by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
#
require 'tk'
class TkNamespace < TkObject
extend Tk
TkCommandNames = [
'namespace'.freeze,
].freeze
Tk_Namespace_ID_TBL = TkCore::INTERP.create_table
(Tk_Namespace_... | Ruby |
#
# tk/entry.rb - Tk entry classes
# by Yukihiro Matsumoto <matz@caelum.co.jp>
require 'tk'
require 'tk/label'
require 'tk/scrollable'
require 'tk/validation'
class Tk::Entry<Tk::Label
include X_Scrollable
include TkValidation
TkCommandNames = ['entry'.freeze].freeze
Widge... | Ruby |
#
# tk/bind.rb : control event binding
#
require 'tk'
class TkBindTag
include TkBindCore
#BTagID_TBL = {}
BTagID_TBL = TkCore::INTERP.create_table
(Tk_BINDTAG_ID = ["btag".freeze, "00000".taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
}
TkCore::INTERP.init_ip_env{
... | Ruby |
#
# tk/menubar.rb
#
# Original version:
# Copyright (C) 1998 maeda shugo. All rights reserved.
# This file can be distributed under the terms of the Ruby.
# Usage:
#
# menu_spec = [
# [['File', 0],
# ['Open', proc{puts('Open clicked')}, 0],
# '---',
# ['Quit', proc{exit}, 0]],
# [['Edit', 0],
# ... | Ruby |
#
# tk/labelframe.rb : treat labelframe widget
#
require 'tk'
require 'tk/frame'
class Tk::LabelFrame<Tk::Frame
TkCommandNames = ['labelframe'.freeze].freeze
WidgetClassName = 'Labelframe'.freeze
WidgetClassNames[WidgetClassName] = self
#def create_self(keys)
# if keys and keys != None
# tk_call_withou... | Ruby |
#
# tk/listbox.rb : treat listbox widget
#
require 'tk'
require 'tk/itemconfig'
require 'tk/scrollable'
require 'tk/txtwin_abst'
module TkListItemConfig
include TkItemConfigMethod
def __item_listval_optkeys(id)
[]
end
private :__item_listval_optkeys
end
class Tk::Listbox<TkTextWin
include TkListItemCon... | Ruby |
#
# tk/itemconfig.rb : control item/tag configuration of widget
#
require 'tk'
require 'tkutil'
require 'tk/itemfont.rb'
module TkItemConfigOptkeys
include TkUtil
def __item_optkey_aliases(id)
{}
end
private :__item_optkey_aliases
def __item_numval_optkeys(id)
[]
end
private :__item_numval_optk... | Ruby |
#
# tk/clipboard.rb : methods to treat clipboard
#
require 'tk'
module TkClipboard
include Tk
extend Tk
TkCommandNames = ['clipboard'.freeze].freeze
def self.clear(win=nil)
if win
tk_call_without_enc('clipboard', 'clear', '-displayof', win)
else
tk_call_without_enc('clipboard', 'clear')
... | Ruby |
#
# tk/scale.rb : treat scale widget
#
require 'tk'
class Tk::Scale<TkWindow
TkCommandNames = ['scale'.freeze].freeze
WidgetClassName = 'Scale'.freeze
WidgetClassNames[WidgetClassName] = self
def create_self(keys)
if keys and keys != None
if keys.key?('command') && ! keys['command'].kind_of?(String)... | Ruby |
#
# tk/variable.rb : treat Tk variable object
#
require 'tk'
class TkVariable
include Tk
extend TkCore
include Comparable
#TkCommandNames = ['tkwait'.freeze].freeze
TkCommandNames = ['vwait'.freeze].freeze
#TkVar_CB_TBL = {}
#TkVar_ID_TBL = {}
TkVar_CB_TBL = TkCore::INTERP.create_table
TkVar_ID_TB... | Ruby |
#
# tk/panedwindow.rb : treat panedwindow
#
require 'tk'
class Tk::PanedWindow<TkWindow
TkCommandNames = ['panedwindow'.freeze].freeze
WidgetClassName = 'Panedwindow'.freeze
WidgetClassNames[WidgetClassName] = self
#def create_self(keys)
# if keys and keys != None
# tk_call_without_enc('panedwindow', @... | Ruby |
#
# tk/texttag.rb - methods for treating text tags
#
require 'tk'
require 'tk/text'
require 'tk/tagfont'
class TkTextTag<TkObject
include TkTreatTagFont
include Tk::Text::IndexModMethods
TTagID_TBL = TkCore::INTERP.create_table
(Tk_TextTag_ID = ['tag'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex... | Ruby |
#
# tk/canvas.rb - Tk canvas classes
# by Yukihiro Matsumoto <matz@caelum.co.jp>
#
require 'tk'
require 'tk/canvastag'
require 'tk/itemconfig'
require 'tk/scrollable'
module TkCanvasItemConfig
include TkItemConfigMethod
def __item_strval_optkeys(id)
# maybe need to override... | Ruby |
#
# tk/package.rb : package command
#
require 'tk'
module TkPackage
include TkCore
extend TkPackage
TkCommandNames = ['package'.freeze].freeze
def add_path(path)
Tk::AUTO_PATH.value = Tk::AUTO_PATH.to_a << path
end
def forget(package)
tk_call('package', 'forget', package)
nil
end
def if... | Ruby |
#
# tk/checkbutton.rb : treat checkbutton widget
#
require 'tk'
require 'tk/radiobutton'
class Tk::CheckButton<Tk::RadioButton
TkCommandNames = ['checkbutton'.freeze].freeze
WidgetClassName = 'Checkbutton'.freeze
WidgetClassNames[WidgetClassName] = self
#def create_self(keys)
# if keys and keys != None
# ... | Ruby |
#
# tk/console.rb : control the console on system without a real console
#
require 'tk'
module TkConsole
include Tk
extend Tk
TkCommandNames = ['console'.freeze, 'consoleinterp'.freeze].freeze
def self.create
TkCore::INTERP._create_console
end
self.create # initialize console
def self.title(str... | Ruby |
#
# tk/menu.rb : treat menu and menubutton
#
require 'tk'
require 'tk/itemconfig'
require 'tk/menuspec'
module TkMenuEntryConfig
include TkItemConfigMethod
def __item_cget_cmd(id)
[self.path, 'entrycget', id]
end
private :__item_cget_cmd
def __item_config_cmd(id)
[self.path, 'entryconfigure', id]
... | Ruby |
#
# tk/scrollbox.rb - Tk Listbox with Scrollbar
# as an example of Composite Widget
# by Yukihiro Matsumoto <matz@netlab.co.jp>
#
require 'tk'
require 'tk/listbox'
class TkScrollbox<Tk::Listbox
include TkComposite
def initialize_composite(keys=nil... | Ruby |
#
# tk/palette.rb : methods for Tcl/Tk standard library 'palette.tcl'
# 1998/06/21 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
#
require 'tk'
module TkPalette
include Tk
extend Tk
TkCommandNames = [
'tk_setPalette'.freeze,
'tk_bisque'.freeze,
'tkDarken'.freeze
].freeze
d... | Ruby |
#
# tk/textmark.rb - methods for treating text marks
#
require 'tk'
require 'tk/text'
class TkTextMark<TkObject
include Tk::Text::IndexModMethods
TMarkID_TBL = TkCore::INTERP.create_table
(Tk_TextMark_ID = ['mark'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
free... | Ruby |
#
# tk/scrollbar.rb : treat scrollbar widget
#
require 'tk'
class Tk::Scrollbar<TkWindow
TkCommandNames = ['scrollbar'.freeze].freeze
WidgetClassName = 'Scrollbar'.freeze
WidgetClassNames[WidgetClassName] = self
def create_self(keys)
@assigned = []
@scroll_proc = proc{|*args|
if self.orient == ... | Ruby |
#
# tk/macpkg.rb : methods for Tcl/Tk packages for Macintosh
# 2000/11/22 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
#
# ATTENTION !!
# This is NOT TESTED. Because I have no test-environment.
#
#
require 'tk'
module Tk
def Tk.load_tclscript_rsrc(resource_name, file=None)
# Mac ... | Ruby |
#
# tk/encodedstr.rb : Tk::EncodedString class
#
require 'tk'
###########################################
# string with Tcl's encoding
###########################################
module Tk
class EncodedString < String
Encoding = nil
def self.subst_utf_backslash(str)
# str.gsub(/\\u([0-9A-Fa-f]{1,4})/... | Ruby |
#
# tk/toplevel.rb : treat toplevel widget
#
require 'tk'
require 'tk/wm'
require 'tk/menuspec'
class Tk::Toplevel<TkWindow
include Wm
include TkMenuSpec
TkCommandNames = ['toplevel'.freeze].freeze
WidgetClassName = 'Toplevel'.freeze
WidgetClassNames[WidgetClassName] = self
################# old version
# ... | Ruby |
#
# tk/itemfont.rb : control font of widget items
#
require 'tk'
module TkItemFontOptkeys
def __item_font_optkeys(id)
# maybe need to override
['font']
end
private :__item_font_optkeys
end
module TkTreatItemFont
include TkItemFontOptkeys
def __item_pathname(id)
# maybe need to override
[sel... | Ruby |
#
# remote-tk.rb - supports to control remote Tk interpreters
# by Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
if defined? MultiTkIp
fail RuntimeError, "'remote-tk' library must be required before requiring 'multi-tk'"
end
class MultiTkIp; end
class RemoteTkIp < MultiTkIp; end
clas... | Ruby |
#
# tkbgerror.rb - load tk/bgerror.rb
#
require 'tk/bgerror'
| Ruby |
#
# tkconsole.rb - load tk/console.rb
#
require 'tk/console'
| Ruby |
#
# tkextlib/itk/incr_tk.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
#
require 'tk'
require 'tk/menuspec'
require 'tkextlib/itcl.rb'
# call setup script
require 'tkextlib/itk.rb'
#TkPackage.require('Itk', '3.2')
TkPackage.require('Itk')
module Tk
module Itk
include Tk
e... | Ruby |
#
# setup.rb -- setup script before calling TkPackage.require()
#
# If you need some setup operations (for example, add a library path
# to the library search path) before using Tcl/Tk library packages
# wrapped by Ruby scripts in this directory, please write the setup
# operations in this file.
#
... | Ruby |
#
# setup.rb -- setup script before calling TkPackage.require()
#
# If you need some setup operations (for example, add a library path
# to the library search path) before using Tcl/Tk library packages
# wrapped by Ruby scripts in this directory, please write the setup
# operations in this file.
#
| Ruby |
#
# tkextlib/treectrl/tktreectrl.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
#
require 'tk'
# call setup script for general 'tkextlib' libraries
require 'tkextlib/setup.rb'
# call setup script
require 'tkextlib/treectrl/setup.rb'
# TkPackage.require('treectrl', '1.0')
# TkPackage... | Ruby |
#
# [incr Tcl] support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
#
# call setup script for general 'tkextlib' libraries
require 'tkextlib/setup.rb'
# call setup script
require 'tkextlib/itcl/setup.rb'
# load library
require 'tkextlib/itcl/incr_tcl.rb'
| Ruby |
#
# TkImg extension support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
#
require 'tk'
# call setup script for general 'tkextlib' libraries
require 'tkextlib/setup.rb'
# call setup script
require 'tkextlib/tkimg/setup.rb'
# load all image format handlers
#TkPackage.require('Img', '1... | Ruby |
#
# tkextlib/winico/winico.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
#
require 'tk'
# call setup script for general 'tkextlib' libraries
require 'tkextlib/setup.rb'
# call setup script
require 'tkextlib/winico/setup.rb'
# TkPackage.require('winico', '0.5')
# TkPackage.require('... | Ruby |
#
# setup.rb -- setup script before calling TkPackage.require()
#
# If you need some setup operations (for example, add a library path
# to the library search path) before using Tcl/Tk library packages
# wrapped by Ruby scripts in this directory, please write the setup
# operations in this file.
#
| Ruby |
#
# winico -- Windows Icon extension support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
#
require 'tk'
# call setup script for general 'tkextlib' libraries
require 'tkextlib/setup.rb'
# call setup script
require 'tkextlib/tktable/setup.rb'
# load library
require 'tkextlib/winico/win... | Ruby |
#
# tkextlib/tkHTML/htmlwidget.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
#
require 'tk'
# call setup script for general 'tkextlib' libraries
require 'tkextlib/setup.rb'
# call setup script
require 'tkextlib/tkHTML/setup.rb'
# TkPackage.require('Tkhtml', '2.0')
TkPackage.require... | Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.