Package horizons :: Package gui :: Package widgets :: Module imagebutton :: Class ImageButton
[hide private]
[frames] | no frames]

Class ImageButton

source code

fife.extensions.pychan.widgets.ImageButton --+
                                             |
                                            ImageButton

Extends ImageButton functionality by providing a new path= attribute.
Unless manually overridden, specifying path="path/to/file" (note: no .png
extension) will interpret that as these attributes:

      up_image = "content/gui/path/to/file.png"
    down_image = "content/gui/path/to/file_d.png"
   hover_image = "content/gui/path/to/file_h.png"
inactive_image = "content/gui/path/to/file_bw.png" ("black/white")

Other possible names also checked are
      up_image = "content/gui/path/to/file_u.png" ("up", for tabwidget)
inactive_image = "content/gui/path/to/file_gr.png" ("grayscale")

If some of those files could not be found, we use up_image instead.
Sets is_focusable to False unless overridden.

You can set the button active or inactive (only in code for now).
Setting to inactive will change *all* images (up, down and hover) to the
inactive image. If you set it active again, everything will be reset.

Instance Methods [hide private]
 
__init__(self, path='', inactive_image=None, is_focusable=False, **kwargs) source code
 
toggle(self) source code
 
set_active(self)
Sets the button active.
source code
 
set_inactive(self)
Sets the button inactive.
source code
 
is_active(self) source code
 
_get_path(self) source code
 
_set_path(self, path) source code
Class Variables [hide private]
  ATTRIBUTES = FifeImageButton.ATTRIBUTES+ [Attr('path'), Attr('...
  IMAGE = "content/gui/{path}{{mode}}.png"
  ACTIVE = 0
  INACTIVE = 1
  path = property(_get_path, _set_path)
Method Details [hide private]

set_active(self)

source code 

Sets the button active. Restores up, down and hover image to previous state.

set_inactive(self)

source code 

Sets the button inactive. Overrides up, down and hover image with inactive image.

is_active(self)

source code 
Decorators:
  • @property

Class Variable Details [hide private]

ATTRIBUTES

Value:
FifeImageButton.ATTRIBUTES+ [Attr('path'), Attr('inactive_image')]