Package horizons :: Package gui :: Module windows :: Class Window
[hide private]
[frames] | no frames]

Class Window

source code

Instance Methods [hide private]
 
__init__(self, windows=None) source code
 
open(self, **kwargs)
Open the window.
source code
 
show(self, **kwargs)
Show the window.
source code
 
hide(self)
Hide the window.
source code
 
close(self)
Closes the window.
source code
 
on_escape(self)
Define what happens when ESC is pressed.
source code
 
on_return(self)
Define what happens when RETURN is pressed.
source code
 
_show_modal_background(self)
Loads transparent background that de facto prohibits access to other gui elements by eating all input events.
source code
 
_hide_modal_background(self) source code
Method Details [hide private]

open(self, **kwargs)

source code 

Open the window.

After this call, the window should be visible. If you decide to not show the window here (e.g. an error occurred), you'll need to call `self._windows.close()` to remove the window from the manager.

You may override this method in a subclass if you need to do stuff when a window is first shown.

show(self, **kwargs)

source code 

Show the window.

After this call, the window should be visible. You should *never* call this directly in your code.

hide(self)

source code 

Hide the window.

After this call, the window should not be visible anymore. However, it remains in the stack of open windows and will be visible once it becomes the topmost window again.

You should *never* call this directly in your code, other than in `close()` when you overwrote it in your subclass.

close(self)

source code 

Closes the window.

You should *never* call this directly in your code. Use `self._windows.close()` to ask the WindowManager to remove the window instead.

You may override this method in a subclass if you need to do stuff when a window is closed.

on_escape(self)

source code 

Define what happens when ESC is pressed.

By default, the window will be closed.