How do I add placeholder text for a Memo in a Python FMX GUI App?

61 Views Asked by At

When using TextPrompt on my Edit like in this answer, then it works, but using TextPrompt for my Memo does not work. When using it on my Memo, I get an error:

AttributeError: Error in setting property TextPrompt

Here's my full code:

from delphifmx import *

class frmMain(Form):
    def __init__(self, owner):
        self.Caption = 'My Form'
        self.Width = 400
        self.Height = 200        
        self.Padding.Top = 20
        self.Padding.Right = 20
        self.Padding.Bottom = 20
        self.Padding.Left = 20
        
        self.myEdit = Edit(self)
        self.myEdit.Parent = self
        self.myEdit.Align = "Top"
        self.myEdit.TextPrompt = "Enter your name..."

        self.myMemo = Memo(self)
        self.myMemo.Parent = self
        self.myMemo.Align = "Client"
        self.myMemo.Margins.Top = 20
        self.myMemo.TextPrompt = "Enter your bio..."

def main():
    Application.Initialize()
    Application.Title = "My Application"
    Application.MainForm = frmMain(Application)
    Application.MainForm.Show()
    Application.Run()
    Application.MainForm.Destroy()

main()

The line that fails is:

self.myMemo.TextPrompt = "Enter your bio..."

Why is it working on the Edit, but not on the Memo? How do I add a placeholder on a Memo?

0

There are 0 best solutions below