This commit is contained in:
24
script/test/TestTerminal.py
Normal file
24
script/test/TestTerminal.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import ch.psi.utils.swing.Terminal as Terminal
|
||||
import ch.psi.utils.swing.SwingUtils as SwingUtils
|
||||
terminal=None
|
||||
view=App.getInstance().getMainFrame()
|
||||
tabStatus=view.getStatusTab()
|
||||
|
||||
def showTerminal():
|
||||
global terminal
|
||||
terminal = Terminal(".", 13)
|
||||
tabStatus.addTab("T", terminal)
|
||||
index = tabStatus.getTabCount() - 1
|
||||
SwingUtils.setTabClosable(tabStatus, index)
|
||||
tabStatus.setSelectedComponent(terminal)
|
||||
|
||||
def hideTerminal():
|
||||
global terminal
|
||||
if terminal is not None:
|
||||
tabStatus.remove(terminal)
|
||||
terminal = None
|
||||
|
||||
for i in range (100):
|
||||
showTerminal()
|
||||
hideTerminal()
|
||||
|
||||
Reference in New Issue
Block a user