TerminalApplication.st
changeset 5300 260ccc2864cb
parent 5299 b85cdb7cecc8
child 5305 5e3c955b7c4d
equal deleted inserted replaced
5299:b85cdb7cecc8 5300:260ccc2864cb
    11 "
    11 "
    12 
    12 
    13 "{ Package: 'stx:libtool' }"
    13 "{ Package: 'stx:libtool' }"
    14 
    14 
    15 MultiViewApplication subclass:#TerminalApplication
    15 MultiViewApplication subclass:#TerminalApplication
    16 	instanceVariableNames:''
    16 	instanceVariableNames:'initialDirectory'
    17 	classVariableNames:''
    17 	classVariableNames:''
    18 	poolDictionaries:''
    18 	poolDictionaries:''
    19 	category:'Interface-Smalltalk'
    19 	category:'Interface-Smalltalk'
    20 !
    20 !
    21 
    21 
   325       )
   325       )
   326 ! !
   326 ! !
   327 
   327 
   328 !TerminalApplication class methodsFor:'special startup'!
   328 !TerminalApplication class methodsFor:'special startup'!
   329 
   329 
   330 openWith:initialText
   330 openIn:aDirectory
   331     "launch a new terminal with some initial contents"
   331     "launch a new terminal in some directory"
   332 
   332 
   333     ^ self openWith:initialText selected:false
   333     |terminal|
   334 
   334 
   335     "
   335     terminal := self new.
   336      TerminalApplication openWith:'Transcript showCR:''hello world'''
   336     terminal initialDirectory:aDirectory.
   337     "
   337     terminal open.
   338 !
   338     ^ terminal
   339 
   339 
   340 openWith:initialText selected:selectedBoolean
   340     "
   341     "launch a new terminal with some initial contents"
   341      TerminalApplication open
   342 
   342      TerminalApplication openIn:'/etc'
   343     |workspace|
       
   344 
       
   345     workspace := self new.
       
   346     workspace open.
       
   347     workspace selectedWorkspace contents:initialText selected:selectedBoolean.
       
   348     ^ workspace
       
   349 
       
   350     "
       
   351      TerminalApplication openWith:'Transcript showCR:''hello world'''
       
   352     "
   343     "
   353 ! !
   344 ! !
   354 
   345 
   355 !TerminalApplication methodsFor:'menu-actions'!
   346 !TerminalApplication methodsFor:'menu-actions'!
   356 
   347 
   422     ^ false
   413     ^ false
   423 ! !
   414 ! !
   424 
   415 
   425 !TerminalApplication methodsFor:'startup'!
   416 !TerminalApplication methodsFor:'startup'!
   426 
   417 
       
   418 initialDirectory:aDirectory
       
   419     initialDirectory := aDirectory
       
   420 !
       
   421 
   427 postBuildWith:aBuilder
   422 postBuildWith:aBuilder
   428     |w h|
   423     |w h|
   429 
   424 
   430     super postBuildWith:aBuilder.
   425     super postBuildWith:aBuilder.
   431 
   426 
   446     vt superView realized ifFalse:[
   441     vt superView realized ifFalse:[
   447         self window sensor pushUserEvent:#startShellInSelectedWindow for:self.
   442         self window sensor pushUserEvent:#startShellInSelectedWindow for:self.
   448         ^ self.
   443         ^ self.
   449     ].
   444     ].
   450 
   445 
   451     vt startShellIn:nil.
   446     vt startShellIn:initialDirectory.
   452     vt shellTerminateAction:[ 
   447     vt shellTerminateAction:[ 
   453         "/ vt backgroundColor:(Color red).
   448         "/ vt backgroundColor:(Color red).
   454         vt cr; nextPutLine:('**** shell terminated ****' asText allBold colorizeAllWith:Color red).
   449         vt cr; nextPutLine:('**** shell terminated ****' asText allBold colorizeAllWith:Color red).
   455     ].
   450     ].
   456 ! !
   451 ! !
   457 
   452 
   458 !TerminalApplication class methodsFor:'documentation'!
   453 !TerminalApplication class methodsFor:'documentation'!
   459 
   454 
   460 version
   455 version
   461     ^ '$Header: /cvs/stx/stx/libtool/TerminalApplication.st,v 1.3 2003-10-22 14:48:51 cg Exp $'
   456     ^ '$Header: /cvs/stx/stx/libtool/TerminalApplication.st,v 1.4 2003-10-22 14:52:21 cg Exp $'
   462 ! !
   457 ! !