Hi,
is it possible to embed (any) editable text field inside Roassal?
I managed to add the editor morph inside Trachel's athens canvas, however there is no way I can access it... my guess is that TRMorph takes all the events, or drawing the morph on the canvas destroys something.
I tried it with��PluggableTextFieldMorph (shows the border of the edit field, but no text), and��TxTextEditorMorph (shows text).
Is there any way around this? Adding the morph inside��AthensWrapMorph works correctly, so my guess is that TRMorph must be doing something... perhaps I should also add it as a submorph of TRMorph somehow?
My testing code follows:
------------------------------------------------
"opening the canvas and adding custom shape"
trCanvas := TRCanvas new.
text := SBEditableTextShape new.
trCanvas addShape: text.
trCanvas open.
------------------------------------------------
------------------------------------------------
"content of SBEditableTextShape - same as the attachement"
'From Pharo4.0 of 18 March 2013 [Latest update: #40470] on 1 February 2015 at 10:13:04.069249 pm'!
TRShape subclass: #SBEditableTextShape
instanceVariableNames: 'txMorph txModel wrapMorph textMorph'
classVariableNames: ''
poolDictionaries: ''
category: '_Sandbox'!
!SBEditableTextShape methodsFor: 'drawing' stamp: 'PeterUhnak 2/1/2015 22:10'!
drawOn: aCanvas
" aCanvas fullDrawMorph: textMorph."
aCanvas fullDrawMorph: txMorph.! !
!SBEditableTextShape methodsFor: 'initialization' stamp: 'PeterUhnak 2/1/2015 22:07'!
initialize
| string |
super initialize.
string := 'quick brown fox jumps over the lazy dog'.
txModel := string asTxModel.
txMorph := TxTextEditorMorph text: txModel.
txMorph extent: 150 @ 50.
textMorph := PluggableTextFieldMorph new.
textMorph extent: 150 @ 50.
textMorph setText: string.
textMorph ghostText: 'ghost text'.! !
------------------------------------------------
Any help is appreciated,
Peter