More unit tests
[codimension.git] / thirdparty / pyqtermwidget / doc / usage.rst
blobcb43c0a02a5e0c5747a50965195f319ea2da07ad
1 How to use PyQTermWidget
2 ========================
5 Here is a minimal example:
8 .. code-block:: python
10   #!/usr/bin/env python
11   # -*- coding: utf-8 -*-
13   from PyQt4.QtGui import QApplication
14   from pyqterm import TerminalWidget
15   
16   
17   if __name__ == "__main__":
18       app = QApplication(sys.argv)
19       win = TerminalWidget()
20       win.resize(800, 600)
21       win.show()
22       app.exec_()
26 Look into *demo.py* for a more complete example with a tabbed terminal
27 application.
30 .. image:: screenshot2.png
33 The constructor has the following signature:
35  * def __init__(self, parent=None, command="/bin/bash", font_name="Monospace", font_size=18)
38 The widget has the following methods:
39   
40  * execute(command="/bin/bash")
41  * send(string)
42  * stop()
43  * pid() -> process id (int)
44  * zoom_in()
45  * zoom_out()
46  * text_selection() -> string
47  * update_screen() 
48  * is_alive() -> bool
49  * row_count() -> int
50  * column_count() -> int
51  * text() -> string
54 TerminalWidget inherits directly from QWidget, so it has show, hide,
55 setFont, etc.
58 The widget emits the following signals:
60  * session_closed()
61  * return_pressed()