Jun-18-2019, 12:06 PM
Hello!
I am trying to make a search field with a hint inside with wxPython, but I can't seem to figure out how to change the colour of the hint. If I add a 'SetForegroundColour' the text I type in changes colour, but that doesn't really help. I also fiddled around with 'SetDefaultStyle' and 'wx.TextAttr' for some hours now, but can't figure out where to put them, if that is indeed what I should be doing. Also tried adding styles to the arguments of SearchCtrl like 'wx.TEXT_ATTR_TEXT_COLOUR', but nothing has worked.
So if anyone could point me in the right direction, it would be really great.
Thank you.
I am trying to make a search field with a hint inside with wxPython, but I can't seem to figure out how to change the colour of the hint. If I add a 'SetForegroundColour' the text I type in changes colour, but that doesn't really help. I also fiddled around with 'SetDefaultStyle' and 'wx.TextAttr' for some hours now, but can't figure out where to put them, if that is indeed what I should be doing. Also tried adding styles to the arguments of SearchCtrl like 'wx.TEXT_ATTR_TEXT_COLOUR', but nothing has worked.
query_field = wx.SearchCtrl(panel, pos=(10,10), size=(200,25)) query_field.SetBackgroundColour("black") query_field.SetDescriptiveText("#example") query_field.ShowSearchButton(False)I have made the background black so I can see that there actually is text inside the field, because when I change the background to white, it is completely invisible.
So if anyone could point me in the right direction, it would be really great.
Thank you.