Package horizons :: Package gui :: Package modules :: Module ingame :: Class ChatDialog
[hide private]
[frames] | no frames]

Class ChatDialog

source code

windows.Window --+    
                 |    
    windows.Dialog --+
                     |
                    ChatDialog

Allow player to send messages to other players.

Instance Methods [hide private]
 
__init__(self, windows, session) source code
 
prepare(self)
Setup the dialog gui.
source code
 
act(self, send_message)
Actually initiates chatting and hides the dialog
source code
    Inherited from windows.Dialog
 
_abort(self, retval=False)
Break out of mainloop.
source code
 
_execute(self)
Execute the dialog synchronously.
source code
 
_on_keypress(self, event)
Intercept ESC and ENTER keys and execute the appropriate actions.
source code
 
close(self)
Closes the window.
source code
 
hide(self)
Hide the window.
source code
 
on_escape(self)
Define what happens when ESC is pressed.
source code
 
show(self, **kwargs)
Show the window.
source code
 
trigger_close(self, event_name)
Close the dialog and execute the received event
source code
    Inherited from windows.Window
 
_hide_modal_background(self) 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
 
on_return(self)
Define what happens when RETURN is pressed.
source code
 
open(self, **kwargs)
Open the window.
source code
Class Methods [hide private]
    Inherited from windows.Dialog
 
create_from_widget(cls, dlg, bind, event_map=None, modal=False, focus=None)
Shows any pychan dialog.
source code
Class Variables [hide private]
  focus = 'msg'
hash(x)
    Inherited from windows.Dialog
  modal = False
  return_events = {}
Method Details [hide private]

__init__(self, windows, session)
(Constructor)

source code 
Overrides: windows.Window.__init__

prepare(self)

source code 

Setup the dialog gui.

The widget has to be stored in `self._gui`. If you want to abort the dialog here return False.

Overrides: windows.Dialog.prepare
(inherited documentation)

act(self, send_message)

source code 

Actually initiates chatting and hides the dialog

Overrides: windows.Dialog.act