Table of Contents
Contains the GArrow widget commonly used in the GComboBox and GSpinner widgets.
The following example illustrates how the GArrow widget is used to help create a simplified version of the GSpinner widget.
from grail.rtv import IntegerRTV
from grail.widgets import GTextEntry
var = IntegerRTV(name="__garrow_test")
# event handlers
def _onup():
var.set(var.get() + 1)
def _ondown():
var.set(var.get() - 1)
root = Tkinter.Tk()
up = GArrow(root, height=7, width=14, direction='up')
down = GArrow(root, height=7, width=14, direction='down')
objsignal.listen(down, const.sigON_CLICK, None, _ondown)
objsignal.listen(up, const.sigON_CLICK, None, _onup)
te = GTextEntry(root, rtv=var)
te.grid(row=0, column=0, rowspan=2, sticky=Tkinter.NSEW)
up.grid(row=0, column=1, sticky=Tkinter.NSEW)
down.grid(row=1, column=1, sticky=Tkinter.NSEW)
root.mainloop()
Draws a simple arrow on a canvas widget. This widget attempts to encapsulate all the logic necessary for drawing an arrow button.
Examples of an arrow button are on the spinners and comboboxes.
Inherits all the Tkinter.Canvas keywords. The most important of Tkinter.Canvas keywords are height and width.
Additional keywords are as follows,