2 # tk/winfo.rb : methods for winfo command
13 TkCommandNames = ['winfo'.freeze].freeze
15 def TkWinfo.atom(name, win=nil)
17 number(tk_call_without_enc('winfo', 'atom', '-displayof', win,
18 _get_eval_enc_str(name)))
20 number(tk_call_without_enc('winfo', 'atom', _get_eval_enc_str(name)))
24 TkWinfo.atom(name, self)
27 def TkWinfo.atomname(id, win=nil)
29 _fromUTF8(tk_call_without_enc('winfo', 'atomname',
30 '-displayof', win, id))
32 _fromUTF8(tk_call_without_enc('winfo', 'atomname', id))
35 def winfo_atomname(id)
36 TkWinfo.atomname(id, self)
39 def TkWinfo.cells(win)
40 number(tk_call_without_enc('winfo', 'cells', win))
46 def TkWinfo.children(win)
47 list(tk_call_without_enc('winfo', 'children', win))
53 def TkWinfo.classname(win)
54 tk_call_without_enc('winfo', 'class', win)
57 TkWinfo.classname self
59 alias winfo_class winfo_classname
61 def TkWinfo.colormapfull(win)
62 bool(tk_call_without_enc('winfo', 'colormapfull', win))
64 def winfo_colormapfull
65 TkWinfo.colormapfull self
68 def TkWinfo.containing(rootX, rootY, win=nil)
70 window(tk_call_without_enc('winfo', 'containing',
71 '-displayof', win, rootX, rootY))
73 window(tk_call_without_enc('winfo', 'containing', rootX, rootY))
76 def winfo_containing(x, y)
77 TkWinfo.containing(x, y, self)
80 def TkWinfo.depth(win)
81 number(tk_call_without_enc('winfo', 'depth', win))
87 def TkWinfo.exist?(win)
88 bool(tk_call_without_enc('winfo', 'exists', win))
94 def TkWinfo.fpixels(win, dist)
95 number(tk_call_without_enc('winfo', 'fpixels', win, dist))
97 def winfo_fpixels(dist)
98 TkWinfo.fpixels self, dist
101 def TkWinfo.geometry(win)
102 tk_call_without_enc('winfo', 'geometry', win)
105 TkWinfo.geometry self
108 def TkWinfo.height(win)
109 number(tk_call_without_enc('winfo', 'height', win))
116 tk_call_without_enc('winfo', 'id', win)
122 def TkWinfo.interps(win=nil)
124 #tk_split_simplelist(tk_call_without_enc('winfo', 'interps',
125 # '-displayof', win))
126 tk_split_simplelist(tk_call_without_enc('winfo', 'interps',
130 #tk_split_simplelist(tk_call_without_enc('winfo', 'interps'))
131 tk_split_simplelist(tk_call_without_enc('winfo', 'interps'),
139 def TkWinfo.mapped?(win)
140 bool(tk_call_without_enc('winfo', 'ismapped', win))
146 def TkWinfo.manager(win)
147 tk_call_without_enc('winfo', 'manager', win)
153 def TkWinfo.appname(win)
154 tk_call('winfo', 'name', win)
160 def TkWinfo.parent(win)
161 window(tk_call_without_enc('winfo', 'parent', win))
167 def TkWinfo.widget(id, win=nil)
169 window(tk_call_without_enc('winfo', 'pathname', '-displayof', win, id))
171 window(tk_call_without_enc('winfo', 'pathname', id))
175 TkWinfo.widget id, self
178 def TkWinfo.pixels(win, dist)
179 number(tk_call_without_enc('winfo', 'pixels', win, dist))
181 def winfo_pixels(dist)
182 TkWinfo.pixels self, dist
185 def TkWinfo.reqheight(win)
186 number(tk_call_without_enc('winfo', 'reqheight', win))
189 TkWinfo.reqheight self
192 def TkWinfo.reqwidth(win)
193 number(tk_call_without_enc('winfo', 'reqwidth', win))
196 TkWinfo.reqwidth self
199 def TkWinfo.rgb(win, color)
200 list(tk_call_without_enc('winfo', 'rgb', win, color))
203 TkWinfo.rgb self, color
206 def TkWinfo.rootx(win)
207 number(tk_call_without_enc('winfo', 'rootx', win))
213 def TkWinfo.rooty(win)
214 number(tk_call_without_enc('winfo', 'rooty', win))
220 def TkWinfo.screen(win)
221 tk_call('winfo', 'screen', win)
227 def TkWinfo.screencells(win)
228 number(tk_call_without_enc('winfo', 'screencells', win))
230 def winfo_screencells
231 TkWinfo.screencells self
234 def TkWinfo.screendepth(win)
235 number(tk_call_without_enc('winfo', 'screendepth', win))
237 def winfo_screendepth
238 TkWinfo.screendepth self
241 def TkWinfo.screenheight (win)
242 number(tk_call_without_enc('winfo', 'screenheight', win))
244 def winfo_screenheight
245 TkWinfo.screenheight self
248 def TkWinfo.screenmmheight(win)
249 number(tk_call_without_enc('winfo', 'screenmmheight', win))
251 def winfo_screenmmheight
252 TkWinfo.screenmmheight self
255 def TkWinfo.screenmmwidth(win)
256 number(tk_call_without_enc('winfo', 'screenmmwidth', win))
258 def winfo_screenmmwidth
259 TkWinfo.screenmmwidth self
262 def TkWinfo.screenvisual(win)
263 tk_call_without_enc('winfo', 'screenvisual', win)
265 def winfo_screenvisual
266 TkWinfo.screenvisual self
269 def TkWinfo.screenwidth(win)
270 number(tk_call_without_enc('winfo', 'screenwidth', win))
272 def winfo_screenwidth
273 TkWinfo.screenwidth self
276 def TkWinfo.server(win)
277 tk_call('winfo', 'server', win)
283 def TkWinfo.toplevel(win)
284 window(tk_call_without_enc('winfo', 'toplevel', win))
287 TkWinfo.toplevel self
290 def TkWinfo.visual(win)
291 tk_call_without_enc('winfo', 'visual', win)
297 def TkWinfo.visualid(win)
298 tk_call_without_enc('winfo', 'visualid', win)
301 TkWinfo.visualid self
304 def TkWinfo.visualsavailable(win, includeids=false)
306 list(tk_call_without_enc('winfo', 'visualsavailable',
309 list(tk_call_without_enc('winfo', 'visualsavailable', win))
312 def winfo_visualsavailable(includeids=false)
313 TkWinfo.visualsavailable self, includeids
316 def TkWinfo.vrootheight(win)
317 number(tk_call_without_enc('winfo', 'vrootheight', win))
319 def winfo_vrootheight
320 TkWinfo.vrootheight self
323 def TkWinfo.vrootwidth(win)
324 number(tk_call_without_enc('winfo', 'vrootwidth', win))
327 TkWinfo.vrootwidth self
330 def TkWinfo.vrootx(win)
331 number(tk_call_without_enc('winfo', 'vrootx', win))
337 def TkWinfo.vrooty(win)
338 number(tk_call_without_enc('winfo', 'vrooty', win))
344 def TkWinfo.width(win)
345 number(tk_call_without_enc('winfo', 'width', win))
352 number(tk_call_without_enc('winfo', 'x', win))
359 number(tk_call_without_enc('winfo', 'y', win))
365 def TkWinfo.viewable(win)
366 bool(tk_call_without_enc('winfo', 'viewable', win))
369 TkWinfo.viewable self
372 def TkWinfo.pointerx(win)
373 number(tk_call_without_enc('winfo', 'pointerx', win))
376 TkWinfo.pointerx self
379 def TkWinfo.pointery(win)
380 number(tk_call_without_enc('winfo', 'pointery', win))
383 TkWinfo.pointery self
386 def TkWinfo.pointerxy(win)
387 list(tk_call_without_enc('winfo', 'pointerxy', win))
390 TkWinfo.pointerxy self