Module eagle :: Class Selection
[hide private]
[frames] | no frames]

Class Selection
source code

object --+                
         |                
 _EGObject --+            
             |            
     _EGWidget --+        
                 |        
     _EGDataWidget --+    
                     |    
      _EGWidLabelEntry --+
                         |
                        Selection

Selection box (aka Combo box).

Selection or combo box is an element that allow you to select one of various pre-defined values.

Instance Methods [hide private]
  __init__(self, id, label="", options=None, active=None, callback=None, persistent=False)
Selection constructor.
  __setup_gui__(self)
  __setup_connections__(self)
  get_value(self)
Get data from this widget.
  set_value(self, value)
Set data to this widget.
  append(self, value, set_active=False)
Append new value to available options.
  prepend(self, value)
Prepend new value to available options.
  insert(self, position, value)
Insert new option at position.
  remove(self, value)
Remove given value from available options.
  items(self)
Returns every item/option in this selection.
  options(self)
Returns every item/option in this selection.
  __len__(self)
  __contains__(self, value)
  __iadd__(self, value)
Same as append
  __isub__(self, value)
Same as remove

Inherited from _EGWidLabelEntry: __get_resize_mode__, __repr__, __str__, get_label, set_label

Inherited from _EGWidget: __get_widgets__, hide, set_active, set_inactive, show

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__


Class Variables [hide private]

Inherited from _EGDataWidget: persistent

Inherited from object: __class__


Properties [hide private]
active  

Inherited from _EGWidLabelEntry: label

Inherited from _EGWidget: app

Inherited from _EGObject: id


Method Details [hide private]

__init__(self, id, label="", options=None, active=None, callback=None, persistent=False)
(Constructor)

source code 
Selection constructor.
Parameters:
  • id - unique identifier.
  • label - what to show on a label on the left side of the widget.
  • options - list of possible values.
  • active - selected element.
  • callback - function (or list of functions) that will be called when this widget have its data changed. Function will receive as parameters:
    • App reference
    • Widget reference
    • new value
  • persistent - if this widget should save its data between sessions.
Overrides: _EGWidLabelEntry.__init__

__setup_gui__(self)

source code 
Overrides: _EGWidLabelEntry.__setup_gui__

__setup_connections__(self)

source code 

get_value(self)

source code 
Get data from this widget.
Overrides: _EGWidLabelEntry.get_value

set_value(self, value)

source code 
Set data to this widget.
Overrides: _EGWidLabelEntry.set_value

append(self, value, set_active=False)

source code 
Append new value to available options.
Parameters:
  • value - string that is not already an option.

prepend(self, value)

source code 
Prepend new value to available options.
Parameters:
  • value - string that is not already an option.

insert(self, position, value)

source code 
Insert new option at position.
Parameters:
  • value - string that is not already an option.

remove(self, value)

source code 
Remove given value from available options.
Parameters:
  • value - string that is an option.
Raises:
  • ValueError - if value is not already an option.

items(self)

source code 
Returns every item/option in this selection.

options(self)

source code 
Returns every item/option in this selection.

__len__(self)
(Length operator)

source code 

__contains__(self, value)
(In operator)

source code 

__iadd__(self, value)

source code 
Same as append

__isub__(self, value)

source code 
Same as remove

Property Details [hide private]

active

Get Method:
unreachable.get(self)
Set Method:
unreachable.set(self, value)
Delete Method:
None