This is a generic set of PythonTk UI widgets. There seem to be
several good sets of UI widgets out there. This set strives to fill
in the gaps, though. It is also written to avoid dependance on any
third-party set of tools that you might not have. Each widget is
built from the basic PythonTk building blocks (which everyone
theoretically should have).
It's my first real python code, and coding these are what made me
realize what I missed about programming... the _fun_. Python is a
_fun_ language and this is my contribution and payback to the
community that allowed me to truly enjoy programming again.
Please direct any feedback, bug reports, or requests for enhancements
to
[email protected] and I'll see what I can do about it.
The kit currently includes these basic widgets, with more on the way:
Slider:
This is a PythonTk slider widget... similar to a progress meter or
thermometer widget.
It is highly configurable, can be oriented either horizontally or
vertically, the colors can be changed on the fly, the appearance
of the widget can be modified (raised, sunken, etc), the dimensions
can be changed, the range it displays can be changed, it can be labelled,
a format string can be defined to be automatically applied against the
label text, and it can be set to autoLabel so that the label will
automatically display the value of the bar without any intervention
required.
Configurable settings:
orientation = (horizontal|vertical)
min = leftmost or bottom value on the bar (defaults to 0)
max = rightmost or top value on the bar (defaults to 100)
autolabel = (yes|no)
If set to yes, the label will be redrawn every update
with the labeltext set to the value (formatted
according to the labelFormat). Beware that if you use
this option, the labelText is basically ignored in
favor of formatting the value.
If set to no, you will need to manually call the
relabel method to change the label, and the label will
end up being the labelText formatted according to the
labelFormat instead of using the value.
appearance = (sunken|raised|flat|groove|ridge)
changes the appearance of the bar.
fillColor = The color of the bar itself
background = The color of the background of the bar
labelColor = The color of any label on the bar
labelText = The initial value of the label displayed in the
center of the bar (defaults to blank)
labelFormat = A formatting string which will be applied to the
label of the bar. Automatically applied to the bar
value if autoLabel is set to true, automatically
applied to the labelText if autoLabel is set to
false. Don't leave this blank... if it's just a
string, then set it to "%s".
value = Initial value that the bar should be set to.
bd = The bevel width
Indicator:
This is a widget I use for a panel indicator... sort of a 'light'
that indicates the status of a condition.
Configurable settings:
width = Horizontal width of the light
height = Vertical height of the light
appearance = (sunken|raised|flat|groove|ridge)
changes the appearance of the bar.
onColor = Background color when 'lit'
offColor = Background color when 'unlit'
onLabelColor = Label color when 'lit'
offLabelColor = Label color when 'unlit'
onLabelText = Label text when 'lit'
offLabelText = Label text when 'unlit'
on = initial status
bd = border width of the bevel
Blinker:
This is a blinking version of the Indicator widget with a
configurable blink rate. It descends from the Indicator widget, and
adds the blinkrate configurable setting.