Module: Tk::Tcllib::Diagrams

Extended by:
TkCore
Defined in:
lib/tkextlib/tcllib/diagrams.rb

Constant Summary collapse

PACKAGE_NAME =
'Diagrams'.freeze

Constants included from TkCore

TkCore::EventFlag, TkCore::INTERP, TkCore::INTERP_MUTEX, TkCore::INTERP_ROOT_CHECK, TkCore::INTERP_THREAD, TkCore::INTERP_THREAD_STATUS, TkCore::RUN_EVENTLOOP_ON_MAIN_THREAD, TkCore::WIDGET_DESTROY_HOOK, TkCore::WITH_ENCODING, TkCore::WITH_RUBY_VM

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

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, install_cmd, list, num_or_nil, num_or_str, number, procedure, simplelist, slice_ary, string, #subst, tk_tcl2ruby, uninstall_cmd, #uninstall_cmd, window

Methods included from TkEvent

#install_bind, #install_bind_for_event_class

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_nil, num_or_nil, num_or_str, #num_or_str, number, #number, string, #string, uninstall_cmd, untrust

Class Method Details

.arrow(text = nil, length = nil, head = nil) ⇒ Object



130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/tkextlib/tcllib/diagrams.rb', line 130

def arrow(text=nil, length=nil, head=nil)
  if length || head
    text   = '' unless text
    length = '' unless length
    list(tk_call('::Diagrams::arrow', text, length, head))
  else
    if text
      list(tk_call('::Diagrams::arrow', text))
    else
      list(tk_call('::Diagrams::arrow'))
    end
  end
end

.attach(anchor = None) ⇒ Object



160
161
162
# File 'lib/tkextlib/tcllib/diagrams.rb', line 160

def attach(anchor=None)
  tk_call('::Diagrams::attach', anchor)
end

.box(text, width = nil, height = nil) ⇒ Object



68
69
70
71
72
73
74
75
76
# File 'lib/tkextlib/tcllib/diagrams.rb', line 68

def box(text, width=nil, height=nil)
  if width || height
    width  = '' unless width
    height = '' unless height
    list(tk_call('::Diagrams::box', text, width, height))
  else
    list(tk_call('::Diagrams::box', text))
  end
end

.boxcoords(x1, y1, x2, y2) ⇒ Object



216
217
218
# File 'lib/tkextlib/tcllib/diagrams.rb', line 216

def boxcoords(x1, y1, x2, y2)
  list(tk_call('::Diagrams::boxcoords', x1, y1, x2, y2))
end

.bracket(dir, dist, from_pos, to_pos) ⇒ Object



156
157
158
# File 'lib/tkextlib/tcllib/diagrams.rb', line 156

def bracket(dir, dist, from_pos, to_pos)
  list(tk_call('::Diagrams::bracket', dir, dist, from_pos, to_pos))
end

.circle(text, radius = nil) ⇒ Object



88
89
90
91
92
93
94
# File 'lib/tkextlib/tcllib/diagrams.rb', line 88

def circle(text, radius=nil)
  if radius
    list(tk_call('::Diagrams::circle', text, radius))
  else
    list(tk_call('::Diagrams::circle', text))
  end
end

.color(name = None) ⇒ Object



164
165
166
# File 'lib/tkextlib/tcllib/diagrams.rb', line 164

def color(name=None)
  tk_call('::Diagrams::color', name)
end

.computeposObject Also known as: compute_pos



211
212
213
# File 'lib/tkextlib/tcllib/diagrams.rb', line 211

def computepos
  list(tk_call('::Diagrams::computepos'))
end

.currentpos(pos) ⇒ Object Also known as: current_pos, currentpos=, current_pos=



52
53
54
# File 'lib/tkextlib/tcllib/diagrams.rb', line 52

def currentpos(pos)
  list(tk_call('::Diagrams::currentpos', pos))
end

.diamond(text, width = nil, height = nil) ⇒ Object



110
111
112
113
114
115
116
117
118
# File 'lib/tkextlib/tcllib/diagrams.rb', line 110

def diamond(text, width=nil, height=nil)
  if width || height
    width  = '' unless width
    height = '' unless height
    list(tk_call('::Diagrams::diamond', text, width, height))
  else
    list(tk_call('::Diagrams::diamond', text))
  end
end

.direction(dir) ⇒ Object



47
48
49
50
# File 'lib/tkextlib/tcllib/diagrams.rb', line 47

def direction(dir)
  tk_call('::Diagrams::direction', dir)
  dir
end

.drawin(canvas) ⇒ Object Also known as: draw_in



35
36
37
38
# File 'lib/tkextlib/tcllib/diagrams.rb', line 35

def drawin(canvas)
  tk_call('::Diagrams::drawin', canvas)
  canvas
end

.drum(text, width = nil, height = nil) ⇒ Object



120
121
122
123
124
125
126
127
128
# File 'lib/tkextlib/tcllib/diagrams.rb', line 120

def drum(text, width=nil, height=nil)
  if width || height
    width  = '' unless width
    height = '' unless height
    list(tk_call('::Diagrams::drum', text, width, height))
  else
    list(tk_call('::Diagrams::drum', text))
  end
end

.fillcolor(name = None) ⇒ Object



168
169
170
# File 'lib/tkextlib/tcllib/diagrams.rb', line 168

def fillcolor(name=None)
  tk_call('::Diagrams::fillcolor', name)
end

.getpos(anchor, obj) ⇒ Object Also known as: get_pos



59
60
61
# File 'lib/tkextlib/tcllib/diagrams.rb', line 59

def getpos(anchor, obj)
  list(tk_call('::Diagrams::getpos', anchor, obj))
end

.line(*args) ⇒ Object



144
145
146
147
148
149
150
151
152
153
154
# File 'lib/tkextlib/tcllib/diagrams.rb', line 144

def line(*args)
  ary = []
  args.each{|arg|
    if arg.kind_of?(Array) && arg.length == 2  # [length, angle]
      ary.concat arg
    else # ["POSITION", x, y] or length or angle
      ary << arg
    end
  }
  list(tk_call('::Diagrams::line', *ary))
end

.linestyle(style = None) ⇒ Object



197
198
199
# File 'lib/tkextlib/tcllib/diagrams.rb', line 197

def linestyle(style=None)
  tk_call('::Diagrams::linestyle', style)
end

.linewidth(pixels = None) ⇒ Object



193
194
195
# File 'lib/tkextlib/tcllib/diagrams.rb', line 193

def linewidth(pixels=None)
  number(tk_call('::Diagrams::linewidth', pixels))
end

.moveobject(obj) ⇒ Object Also known as: move_object



220
221
222
# File 'lib/tkextlib/tcllib/diagrams.rb', line 220

def moveobject(obj)
  list(tk_call('::Diagrams::moveobject', obj))
end

.package_nameObject



18
19
20
# File 'lib/tkextlib/tcllib/diagrams.rb', line 18

def self.package_name
  PACKAGE_NAME
end

.package_versionObject



22
23
24
25
26
27
28
# File 'lib/tkextlib/tcllib/diagrams.rb', line 22

def self.package_version
  begin
    TkPackage.require('Diagrams')
  rescue
    ''
  end
end

.plaintext(text, width = nil, height = nil) ⇒ Object



78
79
80
81
82
83
84
85
86
# File 'lib/tkextlib/tcllib/diagrams.rb', line 78

def plaintext(text, width=nil, height=nil)
  if width || height
    width  = '' unless width
    height = '' unless height
    list(tk_call('::Diagrams::plaintext', text, width, height))
  else
    list(tk_call('::Diagrams::plaintext', text))
  end
end

.popstateObject Also known as: pop_state



206
207
208
# File 'lib/tkextlib/tcllib/diagrams.rb', line 206

def popstate
  tk_call('::Diagrams::popstate')
end

.position(x, y) ⇒ Object



64
65
66
# File 'lib/tkextlib/tcllib/diagrams.rb', line 64

def position(x, y)
  list(tk_call('::Diagrams::position', x, y))
end

.pushstateObject Also known as: push_state



201
202
203
# File 'lib/tkextlib/tcllib/diagrams.rb', line 201

def pushstate
  tk_call('::Diagrams::pushstate')
end

.saveps(filename) ⇒ Object Also known as: save_ps



41
42
43
44
# File 'lib/tkextlib/tcllib/diagrams.rb', line 41

def saveps(filename)
  tk_call('::Diagrams::saveps', filename)
  filename
end

.slanted(text, width = nil, height = nil, angle = nil) ⇒ Object



96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/tkextlib/tcllib/diagrams.rb', line 96

def slanted(text, width=nil, height=nil, angle=nil)
  if width || height || angle
    width  = '' unless width
    height = '' unless height
    if angle
      list(tk_call('::Diagrams::slanted', text, width, height, angle))
    else
      list(tk_call('::Diagrams::slanted', text, width, height))
    end
  else
    list(tk_call('::Diagrams::slanted', text))
  end
end

.textcolor(name = None) ⇒ Object



172
173
174
# File 'lib/tkextlib/tcllib/diagrams.rb', line 172

def textcolor(name=None)
  tk_call('::Diagrams::textcolor', name)
end

.textfont(fnt = None) ⇒ Object



189
190
191
# File 'lib/tkextlib/tcllib/diagrams.rb', line 189

def textfont(fnt=None)
  tk_call('::Diagrams::textfont', fnt)
end

.usegap(mode = None) ⇒ Object Also known as: use_gap



176
177
178
# File 'lib/tkextlib/tcllib/diagrams.rb', line 176

def usegap(mode=None)
  bool(tk_call('::Diagrams::usegap', mode))
end

.xgap(val = None) ⇒ Object



181
182
183
# File 'lib/tkextlib/tcllib/diagrams.rb', line 181

def xgap(val=None)
  number(tk_call('::Diagrams::xgap', val))
end

.ygap(val = None) ⇒ Object



185
186
187
# File 'lib/tkextlib/tcllib/diagrams.rb', line 185

def ygap(val=None)
  number(tk_call('::Diagrams::ygap', val))
end