Paved::button - an extension of the button widget
package require Paved::button
Paved::button pathName ?options?
Paved::button is an extension of the button widget.
A Paved-Button is simply a button with a paved (tiled) background.
.. all button options are supported.
Be careful that -image option has been removed (replaced by -tile) (see below)
The -compound option only accepts the following values: none, center. Other 'valid' values are forced to center.
.. all button widget commands are supported.
no extended command.
A script is attached to the <Configure> event for the pseudo class PavedButton, so that each time the widget is resized, the background image is resized accordling.
package require Paved::button # suppose xyz.gif is in current directory image create photo xyzImage -file xyz.gif # create a tiled-label widget; use 'xyzImage' as background. # and place a text centered Paved::button .b -tile xyzImage -borderwidth 10 -relief sunken \ -compound center -text "This is a paved-button widget" pack .b -fill both -expand true wm geometry . 200x200
or in a more compact form:
package require Paved::button Paved::button .b -tile xyz.gif -borderwidth 10 -relief sunken \ -compound center -text "This is a paved-button widget" pack .b -fill both -expand true wm geometry . 200x200
Unless your Paved::button is 'expanded' by the geometry manager (e.g. 'packer'), ALWAYS set a (minumum) height/width (options -width, -height), or, its size will 'collapse' to the text size (if any), or to few pixels (if -text is empty).
For each Paved::button widget ".x" , the following items will be created:
These items should never be manipulated. They will be automatically destroyed when widget ".x" is destroyed.