Package horizons :: Package gui :: Package tabs :: Module diplomacytab :: Class PlayerDiplomacyTab
[hide private]
[frames] | no frames]

Class PlayerDiplomacyTab

source code

tabinterface.TabInterface --+
                            |
                           PlayerDiplomacyTab

Diplomacy tab set per player. It displays the menu for selecting the status between the local player and the tab's player

Instance Methods [hide private]
 
__init__(self, player) source code
 
init_widget(self)
Initialize widget after it was loaded.
source code
 
show(self)
Shows the current widget
source code
 
hide(self)
Hides the current widget
source code
 
add_ally(self)
Callback for setting ally status between local player and tab's player
source code
 
add_neutral(self)
Callback for setting neutral status between local player and tab's player
source code
 
add_enemy(self)
Callback for setting enemy status between local player and tab's player
source code
 
check_diplomacy_state(self)
Checks the box with the diplomacy status between local player and selected player
source code
    Inherited from tabinterface.TabInterface
 
_get_position(self) source code
 
_schedule_refresh(self)
Schedule a refresh soon, dropping all other refresh request, that appear until then.
source code
 
_set_position(self, value)
Sets the widgets position to tuple *value*
source code
 
_setup_widget(self)
Gets the widget and sets up some attributes and helper.
source code
 
ensure_loaded(self)
Called when a tab is shown, acts as hook for lazy loading
source code
 
get_widget(self)
Loads the filename in self.widget.
source code
 
is_visible(self) source code
 
refresh(self)
This function is called by the TabWidget to redraw the widget.
source code
Class Methods [hide private]
    Inherited from tabinterface.TabInterface
 
shown_for(cls, instance)
Method for fine-grained control of which tabs to show.
source code
Class Variables [hide private]
  widget = 'diplomacy.xml'
hash(x)
  icon_path = 'images/tabwidget/emblems/emblem_%s'
    Inherited from tabinterface.TabInterface
  lazy_loading = True
  position = property(_get_position, _set_position)
  scheduled_update_delay = 0.4
Method Details [hide private]

__init__(self, player)
(Constructor)

source code 
Parameters:
  • widget - filename of a widget. Set this to None if you create your widget in `get_widget`.
  • widget - Filename of widget to load.
  • icon_path - Where to look for ImageButton icons. Note: this is a `path` attribute!
Overrides: tabinterface.TabInterface.__init__
(inherited documentation)

init_widget(self)

source code 

Initialize widget after it was loaded.

Override this in your subclass if you have custom post-load code.

Overrides: tabinterface.TabInterface.init_widget
(inherited documentation)

show(self)

source code 

Shows the current widget

Overrides: tabinterface.TabInterface.show
(inherited documentation)

hide(self)

source code 

Hides the current widget

Overrides: tabinterface.TabInterface.hide
(inherited documentation)