Advertisement
here2share

Help on class Canvas in module Tkinter

May 26th, 2015
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 42.17 KB | None | 0 0
  1. # Help on class Canvas in module Tkinter --
  2.  
  3. from Tkinter import *
  4. from PIL import Image
  5.  
  6. help(Canvas)
  7.  
  8. '''
  9. class Canvas(Widget, XView, YView)
  10. |  Canvas widget to display graphical elements like lines or text.
  11. |  
  12. |  Method resolution order:
  13. |      Canvas
  14. |      Widget
  15. |      BaseWidget
  16. |      Misc
  17. |      Pack
  18. |      Place
  19. |      Grid
  20. |      XView
  21. |      YView
  22. |  
  23. |  Methods defined here:
  24. |  
  25. |  __init__(self, master=None, cnf={}, **kw)
  26. |      Construct a canvas widget with the parent MASTER.
  27. |      
  28. |      Valid resource names: background, bd, bg, borderwidth, closeenough,
  29. |      confine, cursor, height, highlightbackground, highlightcolor,
  30. |      highlightthickness, insertbackground, insertborderwidth,
  31. |      insertofftime, insertontime, insertwidth, offset, relief,
  32. |      scrollregion, selectbackground, selectborderwidth, selectforeground,
  33. |      state, takefocus, width, xscrollcommand, xscrollincrement,
  34. |      yscrollcommand, yscrollincrement.
  35. |  
  36. |  addtag(self, *args)
  37. |      Internal function.
  38. |  
  39. |  addtag_above(self, newtag, tagOrId)
  40. |      Add tag NEWTAG to all items above TAGORID.
  41. |  
  42. |  addtag_all(self, newtag)
  43. |      Add tag NEWTAG to all items.
  44. |  
  45. |  addtag_below(self, newtag, tagOrId)
  46. |      Add tag NEWTAG to all items below TAGORID.
  47. |  
  48. |  addtag_closest(self, newtag, x, y, halo=None, start=None)
  49. |      Add tag NEWTAG to item which is closest to pixel at X, Y.
  50. |      If several match take the top-most.
  51. |      All items closer than HALO are considered overlapping (all are
  52. |      closests). If START is specified the next below this tag is taken.
  53. |  
  54. |  addtag_enclosed(self, newtag, x1, y1, x2, y2)
  55. |      Add tag NEWTAG to all items in the rectangle defined
  56. |      by X1,Y1,X2,Y2.
  57. |  
  58. |  addtag_overlapping(self, newtag, x1, y1, x2, y2)
  59. |      Add tag NEWTAG to all items which overlap the rectangle
  60. |      defined by X1,Y1,X2,Y2.
  61. |  
  62. |  addtag_withtag(self, newtag, tagOrId)
  63. |      Add tag NEWTAG to all items with TAGORID.
  64. |  
  65. |  bbox(self, *args)
  66. |      Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle
  67. |      which encloses all items with tags specified as arguments.
  68. |  
  69. |  canvasx(self, screenx, gridspacing=None)
  70. |      Return the canvas x coordinate of pixel position SCREENX rounded
  71. |      to nearest multiple of GRIDSPACING units.
  72. |  
  73. |  canvasy(self, screeny, gridspacing=None)
  74. |      Return the canvas y coordinate of pixel position SCREENY rounded
  75. |      to nearest multiple of GRIDSPACING units.
  76. |  
  77. |  coords(self, *args)
  78. |      Return a list of coordinates for the item given in ARGS.
  79. |  
  80. |  create_arc(self, *args, **kw)
  81. |      Create arc shaped region with coordinates x1,y1,x2,y2.
  82. |  
  83. |  create_bitmap(self, *args, **kw)
  84. |      Create bitmap with coordinates x1,y1.
  85. |  
  86. |  create_image(self, *args, **kw)
  87. |      Create image item with coordinates x1,y1.
  88. |  
  89. |  create_line(self, *args, **kw)
  90. |      Create line with coordinates x1,y1,...,xn,yn.
  91. |  
  92. |  create_oval(self, *args, **kw)
  93. |      Create oval with coordinates x1,y1,x2,y2.
  94. |  
  95. |  create_polygon(self, *args, **kw)
  96. |      Create polygon with coordinates x1,y1,...,xn,yn.
  97. |  
  98. |  create_rectangle(self, *args, **kw)
  99. |      Create rectangle with coordinates x1,y1,x2,y2.
  100. |  
  101. |  create_text(self, *args, **kw)
  102. |      Create text with coordinates x1,y1.
  103. |  
  104. |  create_window(self, *args, **kw)
  105. |      Create window with coordinates x1,y1,x2,y2.
  106. |  
  107. |  dchars(self, *args)
  108. |      Delete characters of text items identified by tag or id in ARGS (possibly
  109. |      several times) from FIRST to LAST character (including).
  110. |  
  111. |  delete(self, *args)
  112. |      Delete items identified by all tag or ids contained in ARGS.
  113. |  
  114. |  dtag(self, *args)
  115. |      Delete tag or id given as last arguments in ARGS from items
  116. |      identified by first argument in ARGS.
  117. |  
  118. |  find(self, *args)
  119. |      Internal function.
  120. |  
  121. |  find_above(self, tagOrId)
  122. |      Return items above TAGORID.
  123. |  
  124. |  find_all(self)
  125. |      Return all items.
  126. |  
  127. |  find_below(self, tagOrId)
  128. |      Return all items below TAGORID.
  129. |  
  130. |  find_closest(self, x, y, halo=None, start=None)
  131. |      Return item which is closest to pixel at X, Y.
  132. |      If several match take the top-most.
  133. |      All items closer than HALO are considered overlapping (all are
  134. |      closests). If START is specified the next below this tag is taken.
  135. |  
  136. |  find_enclosed(self, x1, y1, x2, y2)
  137. |      Return all items in rectangle defined
  138. |      by X1,Y1,X2,Y2.
  139. |  
  140. |  find_overlapping(self, x1, y1, x2, y2)
  141. |      Return all items which overlap the rectangle
  142. |      defined by X1,Y1,X2,Y2.
  143. |  
  144. |  find_withtag(self, tagOrId)
  145. |      Return all items with TAGORID.
  146. |  
  147. |  focus(self, *args)
  148. |      Set focus to the first item specified in ARGS.
  149. |  
  150. |  gettags(self, *args)
  151. |      Return tags associated with the first item specified in ARGS.
  152. |  
  153. |  icursor(self, *args)
  154. |      Set cursor at position POS in the item identified by TAGORID.
  155. |      In ARGS TAGORID must be first.
  156. |  
  157. |  index(self, *args)
  158. |      Return position of cursor as integer in item specified in ARGS.
  159. |  
  160. |  insert(self, *args)
  161. |      Insert TEXT in item TAGORID at position POS. ARGS must
  162. |      be TAGORID POS TEXT.
  163. |  
  164. |  itemcget(self, tagOrId, option)
  165. |      Return the resource value for an OPTION for item TAGORID.
  166. |  
  167. |  itemconfig = itemconfigure(self, tagOrId, cnf=None, **kw)
  168. |  
  169. |  itemconfigure(self, tagOrId, cnf=None, **kw)
  170. |      Configure resources of an item TAGORID.
  171. |      
  172. |      The values for resources are specified as keyword
  173. |      arguments. To get an overview about
  174. |      the allowed keyword arguments call the method without arguments.
  175. |  
  176. |  lift = tag_raise(self, *args)
  177. |  
  178. |  lower = tag_lower(self, *args)
  179. |  
  180. |  move(self, *args)
  181. |      Move an item TAGORID given in ARGS.
  182. |  
  183. |  postscript(self, cnf={}, **kw)
  184. |      Print the contents of the canvas to a postscript
  185. |      file. Valid options: colormap, colormode, file, fontmap,
  186. |      height, pageanchor, pageheight, pagewidth, pagex, pagey,
  187. |      rotate, witdh, x, y.
  188. |  
  189. |  scale(self, *args)
  190. |      Scale item TAGORID with XORIGIN, YORIGIN, XSCALE, YSCALE.
  191. |  
  192. |  scan_dragto(self, x, y, gain=10)
  193. |      Adjust the view of the canvas to GAIN times the
  194. |      difference between X and Y and the coordinates given in
  195. |      scan_mark.
  196. |  
  197. |  scan_mark(self, x, y)
  198. |      Remember the current X, Y coordinates.
  199. |  
  200. |  select_adjust(self, tagOrId, index)
  201. |      Adjust the end of the selection near the cursor of an item TAGORID to index.
  202. |  
  203. |  select_clear(self)
  204. |      Clear the selection if it is in this widget.
  205. |  
  206. |  select_from(self, tagOrId, index)
  207. |      Set the fixed end of a selection in item TAGORID to INDEX.
  208. |  
  209. |  select_item(self)
  210. |      Return the item which has the selection.
  211. |  
  212. |  select_to(self, tagOrId, index)
  213. |      Set the variable end of a selection in item TAGORID to INDEX.
  214. |  
  215. |  tag_bind(self, tagOrId, sequence=None, func=None, add=None)
  216. |      Bind to all items with TAGORID at event SEQUENCE a call to function FUNC.
  217. |      
  218. |      An additional boolean parameter ADD specifies whether FUNC will be
  219. |      called additionally to the other bound function or whether it will
  220. |      replace the previous function. See bind for the return value.
  221. |  
  222. |  tag_lower(self, *args)
  223. |      Lower an item TAGORID given in ARGS
  224. |      (optional below another item).
  225. |  
  226. |  tag_raise(self, *args)
  227. |      Raise an item TAGORID given in ARGS
  228. |      (optional above another item).
  229. |  
  230. |  tag_unbind(self, tagOrId, sequence, funcid=None)
  231. |      Unbind for all items with TAGORID for event SEQUENCE  the
  232. |      function identified with FUNCID.
  233. |  
  234. |  tkraise = tag_raise(self, *args)
  235. |  
  236. |  type(self, tagOrId)
  237. |      Return the type of the item TAGORID.
  238. |  
  239. |  ----------------------------------------------------------------------
  240. |  Methods inherited from BaseWidget:
  241. |  
  242. |  destroy(self)
  243. |      Destroy this and all descendants widgets.
  244. |  
  245. |  ----------------------------------------------------------------------
  246. |  Methods inherited from Misc:
  247. |  
  248. |  __contains__(self, key)
  249. |  
  250. |  __getitem__ = cget(self, key)
  251. |      Return the resource value for a KEY given as string.
  252. |  
  253. |  __setitem__(self, key, value)
  254. |  
  255. |  __str__(self)
  256. |      Return the window path name of this widget.
  257. |  
  258. |  after(self, ms, func=None, *args)
  259. |      Call function once after given time.
  260. |      
  261. |      MS specifies the time in milliseconds. FUNC gives the
  262. |      function which shall be called. Additional parameters
  263. |      are given as parameters to the function call.  Return
  264. |      identifier to cancel scheduling with after_cancel.
  265. |  
  266. |  after_cancel(self, id)
  267. |      Cancel scheduling of function identified with ID.
  268. |      
  269. |      Identifier returned by after or after_idle must be
  270. |      given as first parameter.
  271. |  
  272. |  after_idle(self, func, *args)
  273. |      Call FUNC once if the Tcl main loop has no event to
  274. |      process.
  275. |      
  276. |      Return an identifier to cancel the scheduling with
  277. |      after_cancel.
  278. |  
  279. |  bell(self, displayof=0)
  280. |      Ring a display's bell.
  281. |  
  282. |  bind(self, sequence=None, func=None, add=None)
  283. |      Bind to this widget at event SEQUENCE a call to function FUNC.
  284. |      
  285. |      SEQUENCE is a string of concatenated event
  286. |      patterns. An event pattern is of the form
  287. |      <MODIFIER-MODIFIER-TYPE-DETAIL> where MODIFIER is one
  288. |      of Control, Mod2, M2, Shift, Mod3, M3, Lock, Mod4, M4,
  289. |      Button1, B1, Mod5, M5 Button2, B2, Meta, M, Button3,
  290. |      B3, Alt, Button4, B4, Double, Button5, B5 Triple,
  291. |      Mod1, M1. TYPE is one of Activate, Enter, Map,
  292. |      ButtonPress, Button, Expose, Motion, ButtonRelease
  293. |      FocusIn, MouseWheel, Circulate, FocusOut, Property,
  294. |      Colormap, Gravity Reparent, Configure, KeyPress, Key,
  295. |      Unmap, Deactivate, KeyRelease Visibility, Destroy,
  296. |      Leave and DETAIL is the button number for ButtonPress,
  297. |      ButtonRelease and DETAIL is the Keysym for KeyPress and
  298. |      KeyRelease. Examples are
  299. |      <Control-Button-1> for pressing Control and mouse button 1 or
  300. |      <Alt-A> for pressing A and the Alt key (KeyPress can be omitted).
  301. |      An event pattern can also be a virtual event of the form
  302. |      <<AString>> where AString can be arbitrary. This
  303. |      event can be generated by event_generate.
  304. |      If events are concatenated they must appear shortly
  305. |      after each other.
  306. |      
  307. |      FUNC will be called if the event sequence occurs with an
  308. |      instance of Event as argument. If the return value of FUNC is
  309. |      "break" no further bound function is invoked.
  310. |      
  311. |      An additional boolean parameter ADD specifies whether FUNC will
  312. |      be called additionally to the other bound function or whether
  313. |      it will replace the previous function.
  314. |      
  315. |      Bind will return an identifier to allow deletion of the bound function with
  316. |      unbind without memory leak.
  317. |      
  318. |      If FUNC or SEQUENCE is omitted the bound function or list
  319. |      of bound events are returned.
  320. |  
  321. |  bind_all(self, sequence=None, func=None, add=None)
  322. |      Bind to all widgets at an event SEQUENCE a call to function FUNC.
  323. |      An additional boolean parameter ADD specifies whether FUNC will
  324. |      be called additionally to the other bound function or whether
  325. |      it will replace the previous function. See bind for the return value.
  326. |  
  327. |  bind_class(self, className, sequence=None, func=None, add=None)
  328. |      Bind to widgets with bindtag CLASSNAME at event
  329. |      SEQUENCE a call of function FUNC. An additional
  330. |      boolean parameter ADD specifies whether FUNC will be
  331. |      called additionally to the other bound function or
  332. |      whether it will replace the previous function. See bind for
  333. |      the return value.
  334. |  
  335. |  bindtags(self, tagList=None)
  336. |      Set or get the list of bindtags for this widget.
  337. |      
  338. |      With no argument return the list of all bindtags associated with
  339. |      this widget. With a list of strings as argument the bindtags are
  340. |      set to this list. The bindtags determine in which order events are
  341. |      processed (see bind).
  342. |  
  343. |  cget(self, key)
  344. |      Return the resource value for a KEY given as string.
  345. |  
  346. |  clipboard_append(self, string, **kw)
  347. |      Append STRING to the Tk clipboard.
  348. |      
  349. |      A widget specified at the optional displayof keyword
  350. |      argument specifies the target display. The clipboard
  351. |      can be retrieved with selection_get.
  352. |  
  353. |  clipboard_clear(self, **kw)
  354. |      Clear the data in the Tk clipboard.
  355. |      
  356. |      A widget specified for the optional displayof keyword
  357. |      argument specifies the target display.
  358. |  
  359. |  clipboard_get(self, **kw)
  360. |      Retrieve data from the clipboard on window's display.
  361. |      
  362. |      The window keyword defaults to the root window of the Tkinter
  363. |      application.
  364. |      
  365. |      The type keyword specifies the form in which the data is
  366. |      to be returned and should be an atom name such as STRING
  367. |      or FILE_NAME.  Type defaults to STRING, except on X11, where the default
  368. |      is to try UTF8_STRING and fall back to STRING.
  369. |      
  370. |      This command is equivalent to:
  371. |      
  372. |      selection_get(CLIPBOARD)
  373. |  
  374. |  colormodel(self, value=None)
  375. |      Useless. Not implemented in Tk.
  376. |  
  377. |  columnconfigure = grid_columnconfigure(self, index, cnf={}, **kw)
  378. |      Configure column INDEX of a grid.
  379. |      
  380. |      Valid resources are minsize (minimum size of the column),
  381. |      weight (how much does additional space propagate to this column)
  382. |      and pad (how much space to let additionally).
  383. |  
  384. |  config = configure(self, cnf=None, **kw)
  385. |      Configure resources of a widget.
  386. |      
  387. |      The values for resources are specified as keyword
  388. |      arguments. To get an overview about
  389. |      the allowed keyword arguments call the method keys.
  390. |  
  391. |  configure(self, cnf=None, **kw)
  392. |      Configure resources of a widget.
  393. |      
  394. |      The values for resources are specified as keyword
  395. |      arguments. To get an overview about
  396. |      the allowed keyword arguments call the method keys.
  397. |  
  398. |  deletecommand(self, name)
  399. |      Internal function.
  400. |      
  401. |      Delete the Tcl command provided in NAME.
  402. |  
  403. |  event_add(self, virtual, *sequences)
  404. |      Bind a virtual event VIRTUAL (of the form <<Name>>)
  405. |      to an event SEQUENCE such that the virtual event is triggered
  406. |      whenever SEQUENCE occurs.
  407. |  
  408. |  event_delete(self, virtual, *sequences)
  409. |      Unbind a virtual event VIRTUAL from SEQUENCE.
  410. |  
  411. |  event_generate(self, sequence, **kw)
  412. |      Generate an event SEQUENCE. Additional
  413. |      keyword arguments specify parameter of the event
  414. |      (e.g. x, y, rootx, rooty).
  415. |  
  416. |  event_info(self, virtual=None)
  417. |      Return a list of all virtual events or the information
  418. |      about the SEQUENCE bound to the virtual event VIRTUAL.
  419. |  
  420. |  focus_displayof(self)
  421. |      Return the widget which has currently the focus on the
  422. |      display where this widget is located.
  423. |      
  424. |      Return None if the application does not have the focus.
  425. |  
  426. |  focus_force(self)
  427. |      Direct input focus to this widget even if the
  428. |      application does not have the focus. Use with
  429. |      caution!
  430. |  
  431. |  focus_get(self)
  432. |      Return the widget which has currently the focus in the
  433. |      application.
  434. |      
  435. |      Use focus_displayof to allow working with several
  436. |      displays. Return None if application does not have
  437. |      the focus.
  438. |  
  439. |  focus_lastfor(self)
  440. |      Return the widget which would have the focus if top level
  441. |      for this widget gets the focus from the window manager.
  442. |  
  443. |  focus_set(self)
  444. |      Direct input focus to this widget.
  445. |      
  446. |      If the application currently does not have the focus
  447. |      this widget will get the focus if the application gets
  448. |      the focus through the window manager.
  449. |  
  450. |  getboolean(self, s)
  451. |      Return a boolean value for Tcl boolean values true and false given as parameter.
  452. |  
  453. |  getvar(self, name='PY_VAR')
  454. |      Return value of Tcl variable NAME.
  455. |  
  456. |  grab_current(self)
  457. |      Return widget which has currently the grab in this application
  458. |      or None.
  459. |  
  460. |  grab_release(self)
  461. |      Release grab for this widget if currently set.
  462. |  
  463. |  grab_set(self)
  464. |      Set grab for this widget.
  465. |      
  466. |      A grab directs all events to this and descendant
  467. |      widgets in the application.
  468. |  
  469. |  grab_set_global(self)
  470. |      Set global grab for this widget.
  471. |      
  472. |      A global grab directs all events to this and
  473. |      descendant widgets on the display. Use with caution -
  474. |      other applications do not get events anymore.
  475. |  
  476. |  grab_status(self)
  477. |      Return None, "local" or "global" if this widget has
  478. |      no, a local or a global grab.
  479. |  
  480. |  grid_bbox(self, column=None, row=None, col2=None, row2=None)
  481. |      Return a tuple of integer coordinates for the bounding
  482. |      box of this widget controlled by the geometry manager grid.
  483. |      
  484. |      If COLUMN, ROW is given the bounding box applies from
  485. |      the cell with row and column 0 to the specified
  486. |      cell. If COL2 and ROW2 are given the bounding box
  487. |      starts at that cell.
  488. |      
  489. |      The returned integers specify the offset of the upper left
  490. |      corner in the master widget and the width and height.
  491. |  
  492. |  grid_columnconfigure(self, index, cnf={}, **kw)
  493. |      Configure column INDEX of a grid.
  494. |      
  495. |      Valid resources are minsize (minimum size of the column),
  496. |      weight (how much does additional space propagate to this column)
  497. |      and pad (how much space to let additionally).
  498. |  
  499. |  grid_location(self, x, y)
  500. |      Return a tuple of column and row which identify the cell
  501. |      at which the pixel at position X and Y inside the master
  502. |      widget is located.
  503. |  
  504. |  grid_propagate(self, flag=['_noarg_'])
  505. |      Set or get the status for propagation of geometry information.
  506. |      
  507. |      A boolean argument specifies whether the geometry information
  508. |      of the slaves will determine the size of this widget. If no argument
  509. |      is given, the current setting will be returned.
  510. |  
  511. |  grid_rowconfigure(self, index, cnf={}, **kw)
  512. |      Configure row INDEX of a grid.
  513. |      
  514. |      Valid resources are minsize (minimum size of the row),
  515. |      weight (how much does additional space propagate to this row)
  516. |      and pad (how much space to let additionally).
  517. |  
  518. |  grid_size(self)
  519. |      Return a tuple of the number of column and rows in the grid.
  520. |  
  521. |  grid_slaves(self, row=None, column=None)
  522. |      Return a list of all slaves of this widget
  523. |      in its packing order.
  524. |  
  525. |  image_names(self)
  526. |      Return a list of all existing image names.
  527. |  
  528. |  image_types(self)
  529. |      Return a list of all available image types (e.g. phote bitmap).
  530. |  
  531. |  keys(self)
  532. |      Return a list of all resource names of this widget.
  533. |  
  534. |  mainloop(self, n=0)
  535. |      Call the mainloop of Tk.
  536. |  
  537. |  nametowidget(self, name)
  538. |      Return the Tkinter instance of a widget identified by
  539. |      its Tcl name NAME.
  540. |  
  541. |  option_add(self, pattern, value, priority=None)
  542. |      Set a VALUE (second parameter) for an option
  543. |      PATTERN (first parameter).
  544. |      
  545. |      An optional third parameter gives the numeric priority
  546. |      (defaults to 80).
  547. |  
  548. |  option_clear(self)
  549. |      Clear the option database.
  550. |      
  551. |      It will be reloaded if option_add is called.
  552. |  
  553. |  option_get(self, name, className)
  554. |      Return the value for an option NAME for this widget
  555. |      with CLASSNAME.
  556. |      
  557. |      Values with higher priority override lower values.
  558. |  
  559. |  option_readfile(self, fileName, priority=None)
  560. |      Read file FILENAME into the option database.
  561. |      
  562. |      An optional second parameter gives the numeric
  563. |      priority.
  564. |  
  565. |  pack_propagate(self, flag=['_noarg_'])
  566. |      Set or get the status for propagation of geometry information.
  567. |      
  568. |      A boolean argument specifies whether the geometry information
  569. |      of the slaves will determine the size of this widget. If no argument
  570. |      is given the current setting will be returned.
  571. |  
  572. |  pack_slaves(self)
  573. |      Return a list of all slaves of this widget
  574. |      in its packing order.
  575. |  
  576. |  place_slaves(self)
  577. |      Return a list of all slaves of this widget
  578. |      in its packing order.
  579. |  
  580. |  propagate = pack_propagate(self, flag=['_noarg_'])
  581. |      Set or get the status for propagation of geometry information.
  582. |      
  583. |      A boolean argument specifies whether the geometry information
  584. |      of the slaves will determine the size of this widget. If no argument
  585. |      is given the current setting will be returned.
  586. |  
  587. |  quit(self)
  588. |      Quit the Tcl interpreter. All widgets will be destroyed.
  589. |  
  590. |  register = _register(self, func, subst=None, needcleanup=1)
  591. |      Return a newly created Tcl function. If this
  592. |      function is called, the Python function FUNC will
  593. |      be executed. An optional function SUBST can
  594. |      be given which will be executed before FUNC.
  595. |  
  596. |  rowconfigure = grid_rowconfigure(self, index, cnf={}, **kw)
  597. |      Configure row INDEX of a grid.
  598. |      
  599. |      Valid resources are minsize (minimum size of the row),
  600. |      weight (how much does additional space propagate to this row)
  601. |      and pad (how much space to let additionally).
  602. |  
  603. |  selection_clear(self, **kw)
  604. |      Clear the current X selection.
  605. |  
  606. |  selection_get(self, **kw)
  607. |      Return the contents of the current X selection.
  608. |      
  609. |      A keyword parameter selection specifies the name of
  610. |      the selection and defaults to PRIMARY.  A keyword
  611. |      parameter displayof specifies a widget on the display
  612. |      to use. A keyword parameter type specifies the form of data to be
  613. |      fetched, defaulting to STRING except on X11, where UTF8_STRING is tried
  614. |      before STRING.
  615. |  
  616. |  selection_handle(self, command, **kw)
  617. |      Specify a function COMMAND to call if the X
  618. |      selection owned by this widget is queried by another
  619. |      application.
  620. |      
  621. |      This function must return the contents of the
  622. |      selection. The function will be called with the
  623. |      arguments OFFSET and LENGTH which allows the chunking
  624. |      of very long selections. The following keyword
  625. |      parameters can be provided:
  626. |      selection - name of the selection (default PRIMARY),
  627. |      type - type of the selection (e.g. STRING, FILE_NAME).
  628. |  
  629. |  selection_own(self, **kw)
  630. |      Become owner of X selection.
  631. |      
  632. |      A keyword parameter selection specifies the name of
  633. |      the selection (default PRIMARY).
  634. |  
  635. |  selection_own_get(self, **kw)
  636. |      Return owner of X selection.
  637. |      
  638. |      The following keyword parameter can
  639. |      be provided:
  640. |      selection - name of the selection (default PRIMARY),
  641. |      type - type of the selection (e.g. STRING, FILE_NAME).
  642. |  
  643. |  send(self, interp, cmd, *args)
  644. |      Send Tcl command CMD to different interpreter INTERP to be executed.
  645. |  
  646. |  setvar(self, name='PY_VAR', value='1')
  647. |      Set Tcl variable NAME to VALUE.
  648. |  
  649. |  size = grid_size(self)
  650. |      Return a tuple of the number of column and rows in the grid.
  651. |  
  652. |  slaves = pack_slaves(self)
  653. |      Return a list of all slaves of this widget
  654. |      in its packing order.
  655. |  
  656. |  tk_bisque(self)
  657. |      Change the color scheme to light brown as used in Tk 3.6 and before.
  658. |  
  659. |  tk_focusFollowsMouse(self)
  660. |      The widget under mouse will get automatically focus. Can not
  661. |      be disabled easily.
  662. |  
  663. |  tk_focusNext(self)
  664. |      Return the next widget in the focus order which follows
  665. |      widget which has currently the focus.
  666. |      
  667. |      The focus order first goes to the next child, then to
  668. |      the children of the child recursively and then to the
  669. |      next sibling which is higher in the stacking order.  A
  670. |      widget is omitted if it has the takefocus resource set
  671. |      to 0.
  672. |  
  673. |  tk_focusPrev(self)
  674. |      Return previous widget in the focus order. See tk_focusNext for details.
  675. |  
  676. |  tk_menuBar(self, *args)
  677. |      Do not use. Needed in Tk 3.6 and earlier.
  678. |  
  679. |  tk_setPalette(self, *args, **kw)
  680. |      Set a new color scheme for all widget elements.
  681. |      
  682. |      A single color as argument will cause that all colors of Tk
  683. |      widget elements are derived from this.
  684. |      Alternatively several keyword parameters and its associated
  685. |      colors can be given. The following keywords are valid:
  686. |      activeBackground, foreground, selectColor,
  687. |      activeForeground, highlightBackground, selectBackground,
  688. |      background, highlightColor, selectForeground,
  689. |      disabledForeground, insertBackground, troughColor.
  690. |  
  691. |  tk_strictMotif(self, boolean=None)
  692. |      Set Tcl internal variable, whether the look and feel
  693. |      should adhere to Motif.
  694. |      
  695. |      A parameter of 1 means adhere to Motif (e.g. no color
  696. |      change if mouse passes over slider).
  697. |      Returns the set value.
  698. |  
  699. |  unbind(self, sequence, funcid=None)
  700. |      Unbind for this widget for event SEQUENCE  the
  701. |      function identified with FUNCID.
  702. |  
  703. |  unbind_all(self, sequence)
  704. |      Unbind for all widgets for event SEQUENCE all functions.
  705. |  
  706. |  unbind_class(self, className, sequence)
  707. |      Unbind for a all widgets with bindtag CLASSNAME for event SEQUENCE
  708. |      all functions.
  709. |  
  710. |  update(self)
  711. |      Enter event loop until all pending events have been processed by Tcl.
  712. |  
  713. |  update_idletasks(self)
  714. |      Enter event loop until all idle callbacks have been called. This
  715. |      will update the display of windows but not process events caused by
  716. |      the user.
  717. |  
  718. |  wait_variable(self, name='PY_VAR')
  719. |      Wait until the variable is modified.
  720. |      
  721. |      A parameter of type IntVar, StringVar, DoubleVar or
  722. |      BooleanVar must be given.
  723. |  
  724. |  wait_visibility(self, window=None)
  725. |      Wait until the visibility of a WIDGET changes
  726. |      (e.g. it appears).
  727. |      
  728. |      If no parameter is given self is used.
  729. |  
  730. |  wait_window(self, window=None)
  731. |      Wait until a WIDGET is destroyed.
  732. |      
  733. |      If no parameter is given self is used.
  734. |  
  735. |  waitvar = wait_variable(self, name='PY_VAR')
  736. |      Wait until the variable is modified.
  737. |      
  738. |      A parameter of type IntVar, StringVar, DoubleVar or
  739. |      BooleanVar must be given.
  740. |  
  741. |  winfo_atom(self, name, displayof=0)
  742. |      Return integer which represents atom NAME.
  743. |  
  744. |  winfo_atomname(self, id, displayof=0)
  745. |      Return name of atom with identifier ID.
  746. |  
  747. |  winfo_cells(self)
  748. |      Return number of cells in the colormap for this widget.
  749. |  
  750. |  winfo_children(self)
  751. |      Return a list of all widgets which are children of this widget.
  752. |  
  753. |  winfo_class(self)
  754. |      Return window class name of this widget.
  755. |  
  756. |  winfo_colormapfull(self)
  757. |      Return true if at the last color request the colormap was full.
  758. |  
  759. |  winfo_containing(self, rootX, rootY, displayof=0)
  760. |      Return the widget which is at the root coordinates ROOTX, ROOTY.
  761. |  
  762. |  winfo_depth(self)
  763. |      Return the number of bits per pixel.
  764. |  
  765. |  winfo_exists(self)
  766. |      Return true if this widget exists.
  767. |  
  768. |  winfo_fpixels(self, number)
  769. |      Return the number of pixels for the given distance NUMBER
  770. |      (e.g. "3c") as float.
  771. |  
  772. |  winfo_geometry(self)
  773. |      Return geometry string for this widget in the form "widthxheight+X+Y".
  774. |  
  775. |  winfo_height(self)
  776. |      Return height of this widget.
  777. |  
  778. |  winfo_id(self)
  779. |      Return identifier ID for this widget.
  780. |  
  781. |  winfo_interps(self, displayof=0)
  782. |      Return the name of all Tcl interpreters for this display.
  783. |  
  784. |  winfo_ismapped(self)
  785. |      Return true if this widget is mapped.
  786. |  
  787. |  winfo_manager(self)
  788. |      Return the window mananger name for this widget.
  789. |  
  790. |  winfo_name(self)
  791. |      Return the name of this widget.
  792. |  
  793. |  winfo_parent(self)
  794. |      Return the name of the parent of this widget.
  795. |  
  796. |  winfo_pathname(self, id, displayof=0)
  797. |      Return the pathname of the widget given by ID.
  798. |  
  799. |  winfo_pixels(self, number)
  800. |      Rounded integer value of winfo_fpixels.
  801. |  
  802. |  winfo_pointerx(self)
  803. |      Return the x coordinate of the pointer on the root window.
  804. |  
  805. |  winfo_pointerxy(self)
  806. |      Return a tuple of x and y coordinates of the pointer on the root window.
  807. |  
  808. |  winfo_pointery(self)
  809. |      Return the y coordinate of the pointer on the root window.
  810. |  
  811. |  winfo_reqheight(self)
  812. |      Return requested height of this widget.
  813. |  
  814. |  winfo_reqwidth(self)
  815. |      Return requested width of this widget.
  816. |  
  817. |  winfo_rgb(self, color)
  818. |      Return tuple of decimal values for red, green, blue for
  819. |      COLOR in this widget.
  820. |  
  821. |  winfo_rootx(self)
  822. |      Return x coordinate of upper left corner of this widget on the
  823. |      root window.
  824. |  
  825. |  winfo_rooty(self)
  826. |      Return y coordinate of upper left corner of this widget on the
  827. |      root window.
  828. |  
  829. |  winfo_screen(self)
  830. |      Return the screen name of this widget.
  831. |  
  832. |  winfo_screencells(self)
  833. |      Return the number of the cells in the colormap of the screen
  834. |      of this widget.
  835. |  
  836. |  winfo_screendepth(self)
  837. |      Return the number of bits per pixel of the root window of the
  838. |      screen of this widget.
  839. |  
  840. |  winfo_screenheight(self)
  841. |      Return the number of pixels of the height of the screen of this widget
  842. |      in pixel.
  843. |  
  844. |  winfo_screenmmheight(self)
  845. |      Return the number of pixels of the height of the screen of
  846. |      this widget in mm.
  847. |  
  848. |  winfo_screenmmwidth(self)
  849. |      Return the number of pixels of the width of the screen of
  850. |      this widget in mm.
  851. |  
  852. |  winfo_screenvisual(self)
  853. |      Return one of the strings directcolor, grayscale, pseudocolor,
  854. |      staticcolor, staticgray, or truecolor for the default
  855. |      colormodel of this screen.
  856. |  
  857. |  winfo_screenwidth(self)
  858. |      Return the number of pixels of the width of the screen of
  859. |      this widget in pixel.
  860. |  
  861. |  winfo_server(self)
  862. |      Return information of the X-Server of the screen of this widget in
  863. |      the form "XmajorRminor vendor vendorVersion".
  864. |  
  865. |  winfo_toplevel(self)
  866. |      Return the toplevel widget of this widget.
  867. |  
  868. |  winfo_viewable(self)
  869. |      Return true if the widget and all its higher ancestors are mapped.
  870. |  
  871. |  winfo_visual(self)
  872. |      Return one of the strings directcolor, grayscale, pseudocolor,
  873. |      staticcolor, staticgray, or truecolor for the
  874. |      colormodel of this widget.
  875. |  
  876. |  winfo_visualid(self)
  877. |      Return the X identifier for the visual for this widget.
  878. |  
  879. |  winfo_visualsavailable(self, includeids=0)
  880. |      Return a list of all visuals available for the screen
  881. |      of this widget.
  882. |      
  883. |      Each item in the list consists of a visual name (see winfo_visual), a
  884. |      depth and if INCLUDEIDS=1 is given also the X identifier.
  885. |  
  886. |  winfo_vrootheight(self)
  887. |      Return the height of the virtual root window associated with this
  888. |      widget in pixels. If there is no virtual root window return the
  889. |      height of the screen.
  890. |  
  891. |  winfo_vrootwidth(self)
  892. |      Return the width of the virtual root window associated with this
  893. |      widget in pixel. If there is no virtual root window return the
  894. |      width of the screen.
  895. |  
  896. |  winfo_vrootx(self)
  897. |      Return the x offset of the virtual root relative to the root
  898. |      window of the screen of this widget.
  899. |  
  900. |  winfo_vrooty(self)
  901. |      Return the y offset of the virtual root relative to the root
  902. |      window of the screen of this widget.
  903. |  
  904. |  winfo_width(self)
  905. |      Return the width of this widget.
  906. |  
  907. |  winfo_x(self)
  908. |      Return the x coordinate of the upper left corner of this widget
  909. |      in the parent.
  910. |  
  911. |  winfo_y(self)
  912. |      Return the y coordinate of the upper left corner of this widget
  913. |      in the parent.
  914. |  
  915. |  ----------------------------------------------------------------------
  916. |  Data and other attributes inherited from Misc:
  917. |  
  918. |  getdouble = <type 'float'>
  919. |      float(x) -> floating point number
  920. |      
  921. |      Convert a string or number to a floating point number, if possible.
  922. |  
  923. |  getint = <type 'int'>
  924. |      int(x=0) -> int or long
  925. |      int(x, base=10) -> int or long
  926. |      
  927. |      Convert a number or string to an integer, or return 0 if no arguments
  928. |      are given.  If x is floating point, the conversion truncates towards zero.
  929. |      If x is outside the integer range, the function returns a long instead.
  930. |      
  931. |      If x is not a number or if base is given, then x must be a string or
  932. |      Unicode object representing an integer literal in the given base.  The
  933. |      literal can be preceded by '+' or '-' and be surrounded by whitespace.
  934. |      The base defaults to 10.  Valid bases are 0 and 2-36.  Base 0 means to
  935. |      interpret the base from the string as an integer literal.
  936. |      >>> int('0b100', base=0)
  937. |      4
  938. |  
  939. |  ----------------------------------------------------------------------
  940. |  Methods inherited from Pack:
  941. |  
  942. |  forget = pack_forget(self)
  943. |      Unmap this widget and do not use it for the packing order.
  944. |  
  945. |  info = pack_info(self)
  946. |      Return information about the packing options
  947. |      for this widget.
  948. |  
  949. |  pack = pack_configure(self, cnf={}, **kw)
  950. |      Pack a widget in the parent widget. Use as options:
  951. |      after=widget - pack it after you have packed widget
  952. |      anchor=NSEW (or subset) - position widget according to
  953. |                                given direction
  954. |      before=widget - pack it before you will pack widget
  955. |      expand=bool - expand widget if parent size grows
  956. |      fill=NONE or X or Y or BOTH - fill widget if widget grows
  957. |      in=master - use master to contain this widget
  958. |      in_=master - see 'in' option description
  959. |      ipadx=amount - add internal padding in x direction
  960. |      ipady=amount - add internal padding in y direction
  961. |      padx=amount - add padding in x direction
  962. |      pady=amount - add padding in y direction
  963. |      side=TOP or BOTTOM or LEFT or RIGHT -  where to add this widget.
  964. |  
  965. |  pack_configure(self, cnf={}, **kw)
  966. |      Pack a widget in the parent widget. Use as options:
  967. |      after=widget - pack it after you have packed widget
  968. |      anchor=NSEW (or subset) - position widget according to
  969. |                                given direction
  970. |      before=widget - pack it before you will pack widget
  971. |      expand=bool - expand widget if parent size grows
  972. |      fill=NONE or X or Y or BOTH - fill widget if widget grows
  973. |      in=master - use master to contain this widget
  974. |      in_=master - see 'in' option description
  975. |      ipadx=amount - add internal padding in x direction
  976. |      ipady=amount - add internal padding in y direction
  977. |      padx=amount - add padding in x direction
  978. |      pady=amount - add padding in y direction
  979. |      side=TOP or BOTTOM or LEFT or RIGHT -  where to add this widget.
  980. |  
  981. |  pack_forget(self)
  982. |      Unmap this widget and do not use it for the packing order.
  983. |  
  984. |  pack_info(self)
  985. |      Return information about the packing options
  986. |      for this widget.
  987. |  
  988. |  ----------------------------------------------------------------------
  989. |  Methods inherited from Place:
  990. |  
  991. |  place = place_configure(self, cnf={}, **kw)
  992. |      Place a widget in the parent widget. Use as options:
  993. |      in=master - master relative to which the widget is placed
  994. |      in_=master - see 'in' option description
  995. |      x=amount - locate anchor of this widget at position x of master
  996. |      y=amount - locate anchor of this widget at position y of master
  997. |      relx=amount - locate anchor of this widget between 0.0 and 1.0
  998. |                    relative to width of master (1.0 is right edge)
  999. |      rely=amount - locate anchor of this widget between 0.0 and 1.0
  1000. |                    relative to height of master (1.0 is bottom edge)
  1001. |      anchor=NSEW (or subset) - position anchor according to given direction
  1002. |      width=amount - width of this widget in pixel
  1003. |      height=amount - height of this widget in pixel
  1004. |      relwidth=amount - width of this widget between 0.0 and 1.0
  1005. |                        relative to width of master (1.0 is the same width
  1006. |                        as the master)
  1007. |      relheight=amount - height of this widget between 0.0 and 1.0
  1008. |                         relative to height of master (1.0 is the same
  1009. |                         height as the master)
  1010. |      bordermode="inside" or "outside" - whether to take border width of
  1011. |                                         master widget into account
  1012. |  
  1013. |  place_configure(self, cnf={}, **kw)
  1014. |      Place a widget in the parent widget. Use as options:
  1015. |      in=master - master relative to which the widget is placed
  1016. |      in_=master - see 'in' option description
  1017. |      x=amount - locate anchor of this widget at position x of master
  1018. |      y=amount - locate anchor of this widget at position y of master
  1019. |      relx=amount - locate anchor of this widget between 0.0 and 1.0
  1020. |                    relative to width of master (1.0 is right edge)
  1021. |      rely=amount - locate anchor of this widget between 0.0 and 1.0
  1022. |                    relative to height of master (1.0 is bottom edge)
  1023. |      anchor=NSEW (or subset) - position anchor according to given direction
  1024. |      width=amount - width of this widget in pixel
  1025. |      height=amount - height of this widget in pixel
  1026. |      relwidth=amount - width of this widget between 0.0 and 1.0
  1027. |                        relative to width of master (1.0 is the same width
  1028. |                        as the master)
  1029. |      relheight=amount - height of this widget between 0.0 and 1.0
  1030. |                         relative to height of master (1.0 is the same
  1031. |                         height as the master)
  1032. |      bordermode="inside" or "outside" - whether to take border width of
  1033. |                                         master widget into account
  1034. |  
  1035. |  place_forget(self)
  1036. |      Unmap this widget.
  1037. |  
  1038. |  place_info(self)
  1039. |      Return information about the placing options
  1040. |      for this widget.
  1041. |  
  1042. |  ----------------------------------------------------------------------
  1043. |  Methods inherited from Grid:
  1044. |  
  1045. |  grid = grid_configure(self, cnf={}, **kw)
  1046. |      Position a widget in the parent widget in a grid. Use as options:
  1047. |      column=number - use cell identified with given column (starting with 0)
  1048. |      columnspan=number - this widget will span several columns
  1049. |      in=master - use master to contain this widget
  1050. |      in_=master - see 'in' option description
  1051. |      ipadx=amount - add internal padding in x direction
  1052. |      ipady=amount - add internal padding in y direction
  1053. |      padx=amount - add padding in x direction
  1054. |      pady=amount - add padding in y direction
  1055. |      row=number - use cell identified with given row (starting with 0)
  1056. |      rowspan=number - this widget will span several rows
  1057. |      sticky=NSEW - if cell is larger on which sides will this
  1058. |                    widget stick to the cell boundary
  1059. |  
  1060. |  grid_configure(self, cnf={}, **kw)
  1061. |      Position a widget in the parent widget in a grid. Use as options:
  1062. |      column=number - use cell identified with given column (starting with 0)
  1063. |      columnspan=number - this widget will span several columns
  1064. |      in=master - use master to contain this widget
  1065. |      in_=master - see 'in' option description
  1066. |      ipadx=amount - add internal padding in x direction
  1067. |      ipady=amount - add internal padding in y direction
  1068. |      padx=amount - add padding in x direction
  1069. |      pady=amount - add padding in y direction
  1070. |      row=number - use cell identified with given row (starting with 0)
  1071. |      rowspan=number - this widget will span several rows
  1072. |      sticky=NSEW - if cell is larger on which sides will this
  1073. |                    widget stick to the cell boundary
  1074. |  
  1075. |  grid_forget(self)
  1076. |      Unmap this widget.
  1077. |  
  1078. |  grid_info(self)
  1079. |      Return information about the options
  1080. |      for positioning this widget in a grid.
  1081. |  
  1082. |  grid_remove(self)
  1083. |      Unmap this widget but remember the grid options.
  1084. |  
  1085. |  location = grid_location(self, x, y)
  1086. |      Return a tuple of column and row which identify the cell
  1087. |      at which the pixel at position X and Y inside the master
  1088. |      widget is located.
  1089. |  
  1090. |  ----------------------------------------------------------------------
  1091. |  Methods inherited from XView:
  1092. |  
  1093. |  xview(self, *args)
  1094. |      Query and change the horizontal position of the view.
  1095. |  
  1096. |  xview_moveto(self, fraction)
  1097. |      Adjusts the view in the window so that FRACTION of the
  1098. |      total width of the canvas is off-screen to the left.
  1099. |  
  1100. |  xview_scroll(self, number, what)
  1101. |      Shift the x-view according to NUMBER which is measured in "units"
  1102. |      or "pages" (WHAT).
  1103. |  
  1104. |  ----------------------------------------------------------------------
  1105. |  Methods inherited from YView:
  1106. |  
  1107. |  yview(self, *args)
  1108. |      Query and change the vertical position of the view.
  1109. |  
  1110. |  yview_moveto(self, fraction)
  1111. |      Adjusts the view in the window so that FRACTION of the
  1112. |      total height of the canvas is off-screen to the top.
  1113. |  
  1114. |  yview_scroll(self, number, what)
  1115. |      Shift the y-view according to NUMBER which is measured in
  1116. |      "units" or "pages" (WHAT).
  1117. '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement