Class { #name : 'TCConsole', #superclass : 'SpPresenter', #instVars : [ 'chat', 'list', 'input' ], #category : 'TinyChat-client', #package : 'TinyChat-client' } { #category : 'as yet unclassified' } TCConsole class >> attach: aTinyChat [ | window | window := self new chat: aTinyChat. window open whenClosedDo: [ aTinyChat disconnect ]. ^ window ] { #category : 'as yet unclassified' } TCConsole class >> defaultLayout [ ^ SpBoxLayout newTopToBottom add: #list; add: #input; yourself ] { #category : 'accessing' } TCConsole >> chat: anObject [ chat := anObject ] { #category : 'accessing' } TCConsole >> initializeWidgets [ list := SpListPresenter new. input := SpTextInputFieldPresenter new placeholder: 'Type your message here...'; enabled: true; whenSubmitDo: [ :string | chat send: string. input text: '' ]. self focusOrder add: input ] { #category : 'accessing' } TCConsole >> input [ ^ input ] { #category : 'accessing' } TCConsole >> list [ ^ list ] { #category : 'accessing' } TCConsole >> print: aCollectionOfMessages [ list items: (aCollectionOfMessages collect: [ :m | m printString ]) ] { #category : 'accessing' } TCConsole >> title [ ^ 'TinyChat' ]