Module: Tk::Tile::Style
Constant Summary
Constants included
from TkCore
TkCore::EventFlag, TkCore::INTERP, TkCore::WIDGET_DESTROY_HOOK
Constants included
from TkComm
TkComm::GET_CONFIGINFO_AS_ARRAY, TkComm::GET_CONFIGINFOwoRES_AS_ARRAY, TkComm::TkExtlibAutoloadModule, TkComm::Tk_CMDTBL, TkComm::Tk_IDs, TkComm::Tk_WINDOWS, TkComm::USE_TCLs_LIST_FUNCTIONS, TkComm::WidgetClassNames
Constants included
from TkUtil
TkUtil::None, TkUtil::RELEASE_DATE
Class Method Summary
collapse
-
.configure(style = nil, keys = nil) ⇒ Object
(also: default)
-
.element_create(name, type, *args) ⇒ Object
-
.element_names ⇒ Object
-
.element_options(elem) ⇒ Object
-
.layout(style = nil, spec = nil) ⇒ Object
-
.lookup(style, opt, state = None, fallback_value = None) ⇒ Object
-
.map(style = nil, keys = nil) ⇒ Object
-
.theme_create(name, keys = nil) ⇒ Object
-
.theme_names ⇒ Object
-
.theme_settings(name, cmd = nil, &b) ⇒ Object
-
.theme_use(name) ⇒ Object
Methods included from TkCore
_tk_call_to_list_core, after, after_cancel, after_idle, appname, appsend, appsend_deny, appsend_displayof, callback, callback_break, callback_continue, callback_return, chooseColor, chooseDirectory, do_one_event, event_generate, getMultipleOpenFile, getMultipleSaveFile, getOpenFile, getSaveFile, get_eventloop_tick, get_eventloop_weight, get_no_event_wait, inactive, inactive_displayof, info, ip_eval, ip_eval_with_enc, ip_eval_without_enc, ip_invoke, ip_invoke_with_enc, ip_invoke_without_enc, is_mainloop?, load_cmd_on_ip, mainloop, mainloop_exist?, mainloop_thread?, mainloop_watchdog, messageBox, rb_appsend, rb_appsend_displayof, reset_inactive, reset_inactive_displayof, restart, scaling, scaling_displayof, set_eventloop_tick, set_eventloop_weight, set_no_event_wait, tk_call, tk_call_to_list, tk_call_to_list_with_enc, tk_call_to_list_without_enc, tk_call_to_simplelist, tk_call_to_simplelist_with_enc, tk_call_to_simplelist_without_enc, tk_call_with_enc, tk_call_without_enc, windowingsystem
Methods included from TkComm
_at, _callback_entry?, _callback_entry_class?, _curr_cmd_id, _fromUTF8, _genobj_for_tkwidget, _next_cmd_id, _toUTF8, array2tk_list, #bind, #bind_all, #bind_append, #bind_append_all, #bind_remove, #bind_remove_all, #bindinfo, #bindinfo_all, bool, image_obj, install_cmd, list, num_or_str, number, procedure, simplelist, string, #subst, tk_tcl2ruby, uninstall_cmd, window
Methods included from TkUtil
_conv_args, #_conv_args, #_fromUTF8, _get_eval_enc_str, #_get_eval_enc_str, #_get_eval_string, _get_eval_string, _symbolkey2str, #_symbolkey2str, #_toUTF8, bool, #bool, callback, eval_cmd, #hash_kv, hash_kv, install_cmd, num_or_str, #num_or_str, number, #number, string, #string, uninstall_cmd
Methods included from TkEvent
#install_bind, #install_bind_for_event_class
Class Method Details
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/tkextlib/tile/style.rb', line 20
def configure(style=nil, keys=nil)
if style.kind_of?(Hash)
keys = style
style = nil
end
style = '.' unless style
if Tk::Tile::TILE_SPEC_VERSION_ID < 7
sub_cmd = 'default'
else
sub_cmd = 'configure'
end
if keys && keys != None
tk_call('style', sub_cmd, style, *hash_kv(keys))
else
tk_call('style', sub_cmd, style)
end
end
|
.element_create(name, type, *args) ⇒ Object
75
76
77
|
# File 'lib/tkextlib/tile/style.rb', line 75
def element_create(name, type, *args)
tk_call('style', 'element', 'create', name, type, *args)
end
|
.element_names ⇒ Object
79
80
81
|
# File 'lib/tkextlib/tile/style.rb', line 79
def element_names()
list(tk_call('style', 'element', 'names'))
end
|
.element_options(elem) ⇒ Object
83
84
85
|
# File 'lib/tkextlib/tile/style.rb', line 83
def element_options(elem)
simplelist(tk_call('style', 'element', 'options', elem))
end
|
.layout(style = nil, spec = nil) ⇒ Object
61
62
63
64
65
66
67
68
69
70
71
72
73
|
# File 'lib/tkextlib/tile/style.rb', line 61
def layout(style=nil, spec=nil)
if style.kind_of?(Hash)
spec = style
style = nil
end
style = '.' unless style
if spec
tk_call('style', 'layout', style, spec)
else
_style_layout(list(tk_call('style', 'layout', style)))
end
end
|
.lookup(style, opt, state = None, fallback_value = None) ⇒ Object
55
56
57
|
# File 'lib/tkextlib/tile/style.rb', line 55
def lookup(style, opt, state=None, fallback_value=None)
tk_call('style', 'lookup', style, '-' << opt.to_s, state, fallback_value)
end
|
.map(style = nil, keys = nil) ⇒ Object
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/tkextlib/tile/style.rb', line 41
def map(style=nil, keys=nil)
if style.kind_of?(Hash)
keys = style
style = nil
end
style = '.' unless style
if keys && keys != None
tk_call('style', 'map', style, *hash_kv(keys))
else
tk_call('style', 'map', style)
end
end
|
.theme_create(name, keys = nil) ⇒ Object
87
88
89
90
91
92
93
|
# File 'lib/tkextlib/tile/style.rb', line 87
def theme_create(name, keys=nil)
if keys && keys != None
tk_call('style', 'theme', 'create', name, *hash_kv(keys))
else
tk_call('style', 'theme', 'create', name)
end
end
|
.theme_names ⇒ Object
100
101
102
|
# File 'lib/tkextlib/tile/style.rb', line 100
def theme_names()
list(tk_call('style', 'theme', 'names'))
end
|
.theme_settings(name, cmd = nil, &b) ⇒ Object
95
96
97
98
|
# File 'lib/tkextlib/tile/style.rb', line 95
def theme_settings(name, cmd=nil, &b)
cmd = Proc.new(&b) if !cmd && b
tk_call('style', 'theme', 'settings', name, cmd)
end
|
.theme_use(name) ⇒ Object
104
105
106
|
# File 'lib/tkextlib/tile/style.rb', line 104
def theme_use(name)
tk_call('style', 'theme', 'use', name)
end
|