Skip to content

Commit

Permalink
Better docstring for SmartSpinBox
Browse files Browse the repository at this point in the history
  • Loading branch information
slightlynybbled committed May 4, 2018
1 parent 85ce29c commit a36c8f4
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions tk_tools/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,14 @@ class SmartSpinBox(tk.Spinbox, SmartWidget):
Attempts to call your callback function - if assigned - whenever there
is a change to the spinbox.::
# create a callback function
def callback(value):
print('the new value is: ', value)
# create the smart spinbox and grid
ssb = SmartSpinBox(root, from_=0, to=5)
ssb = SmartSpinBox(root, from_=0, to=5, callback=callback)
ssb.grid()
# define a callback function that retrieves
# the currently selected option
def callback():
print(ssb.get())
# add the callback function to the spinbox
ssb.add_callback(callback)
:param parent: the tk parent frame
:param entry_type: 'str', 'int', 'float'
:param callback: python callable
Expand Down

0 comments on commit a36c8f4

Please sign in to comment.