I have a simple popover class - taPopover - a desktopContainer containing a textArea. Its property .text copies the string into the text area. Changes to the textArea raise a TextChanged event.
A button on a window calls the popover and enters text into the popover text area. Clicking away from the popover closes (or hides, not sure) the popover. Changes in text in the popover are sent via an event handler back to the window calling the popover.
If I use this in the calculated property for the pop, then the textArea does get populated, but the app crashes on trying to open the pop again with a nil object - as the textArea no longer seems to be present.
Private Property pop As taPopover
Get
If mPop = Nil Then
mPop = New taPopOver
AddHandler mPop.textChanged, AddressOf on_nameChanged
End If
return mpop
End Get
Set
End Set
End Property
If I use this in the calculated property, then the text does not get populated, but I can continually reopen the pop - even though it is blank.
Private Property pop As taPopover
Get
'If mPop = Nil Then
mPop = New taPopOver
AddHandler mPop.textChanged, AddressOf on_nameChanged
'End If
Return mpop
End Get
Set
End Set
End Property
in both cases adding text to the textArea does trigger the event sending the text to the window, but the popover doesn’t work as expected in either.
How can I solve this?
4 posts - 3 participants