Module eagle :: Class Button
[show private | hide private]
[frames | no frames]

Type Button

object --+        
         |        
 _EGObject --+    
             |    
     _EGWidget --+
                 |
                Button

Known Subclasses:
AboutButton, CloseButton, HelpButton, OpenFileButton, PreferencesButton, QuitButton, SaveFileButton, SelectFolderButton

A push button.
Method Summary
  __init__(self, id, label, stock, image, callback, expand_policy, active, visible)
Push button constructor.
  __setup_connections__(self)
  __setup_gui__(self)
  get_image(self)
  get_label(self)
  set_image(self, image)
  set_label(self, label)
    Inherited from _EGWidget
  __configure_orientation__(self, setting)
  __get_widgets__(self)
Return a list of internal widgets this Eagle widget contains.
  _get_widgets(self)
  _set_widgets(self, value)
  disable(self)
Same as set_active( False )
  enable(self, active)
Set the widget as active.
  focus(self)
Give keyboard focus to this widget.
  get_active(self)
Return True if it's active (enabled) or False inactive (disabled).
  get_visible(self)
Return true if widget is visible (shown).
  hide(self)
Make widget invisible.
  is_active(self)
Return True if it's active (enabled) or False inactive (disabled).
  is_enabled(self)
Return True if it's active (enabled) or False inactive (disabled).
  is_visible(self)
Return true if widget is visible (shown).
  set_active(self, active)
Set the widget as active.
  set_inactive(self)
Same as set_active( False )
  set_visible(self, visible)
Show or hide widget based on value of 'visible'.
  show(self)
Make widget visible.
    Inherited from _EGObject
  __repr__(self)
  __str__(self)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value

Property Summary
  callback
  image
  label
  stock
    Inherited from _EGWidget
  _widgets
  active
  app
  visible
    Inherited from _EGObject
  id

Class Variable Summary
tuple stock_items = ('new', 'about', 'help', 'quit', 'add', 'r...
dict _gtk_stock_map = {'media:forward': 'gtk-media-forward', ...
    Inherited from _EGWidget
int ORIENTATION_HORIZONTAL = 1                                                                     
int ORIENTATION_VERTICAL = 0                                                                     

Method Details

__init__(self, id, label='', stock=None, image=None, callback=None, expand_policy=None, active=True, visible=True)
(Constructor)

Push button constructor.

It may be a stock button, that is, a pre-defined button that may have an associated image and translated label text.

It may have an image either by using a stock button or giving image as parameter, but this image will only be visible if system configuration wants that, GTK does that with gtk-button-images property present on gtk.Settings.
Parameters:
label - what text to show, if stock isn't provided.
stock - optional. One of stock_items.
image - image filename (or Image instance) to use.
callback - the function (or list of functions) to call when button is pressed. Function will get as parameter:
  • App reference
  • Button reference
expand_policy - how this widget should fit space, see ExpandPolicy.Policy.Rule.
Overrides:
eagle._EGWidget.__init__

Property Details

callback

Get Method:
get(...)
Set Method:
set(...)

image

Get Method:
get_image(self)
Set Method:
set_image(self, image)

label

Get Method:
get_label(self)
Set Method:
set_label(self, label)

stock

Get Method:
get(...)
Set Method:
set(...)

Class Variable Details

stock_items

Type:
tuple
Value:
('new', 'about', 'help', 'quit', 'add', 'remove', 'edit', 'refresh', '\
update')                                                               

_gtk_stock_map

Type:
dict
Value:
{'about': 'gtk-about',
 'add': 'gtk-add',
 'apply': 'gtk-apply',
 'back': 'gtk-go-back',
 'cancel': 'gtk-cancel',
 'clear': 'gtk-clear',
 'close': 'gtk-close',
 'color': 'gtk-select-color',
...                                                                    

Generated by Epydoc 2.1 on Sun Apr 22 21:30:28 2007 http://epydoc.sf.net