Avoid GTK warning "invalid cast from 'GtkTextView' to 'GtkEntry'" when using SetHint()
closes #16321
This commit is contained in:
@@ -851,7 +851,10 @@ GtkEditable *wxTextCtrl::GetEditable() const
|
||||
|
||||
GtkEntry *wxTextCtrl::GetEntry() const
|
||||
{
|
||||
return GTK_ENTRY(m_text);
|
||||
if (GTK_IS_ENTRY(m_text))
|
||||
return (GtkEntry*)m_text;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int wxTextCtrl::GTKIMFilterKeypress(GdkEventKey* event) const
|
||||
|
@@ -521,7 +521,7 @@ bool wxTextEntry::SetHint(const wxString& hint)
|
||||
{
|
||||
#if GTK_CHECK_VERSION(3,2,0)
|
||||
GtkEntry *entry = GetEntry();
|
||||
if (entry && GTK_IS_ENTRY(entry) && gtk_check_version(3,2,0) == NULL)
|
||||
if (entry && gtk_check_version(3,2,0) == NULL)
|
||||
{
|
||||
gtk_entry_set_placeholder_text(entry, wxGTK_CONV(hint));
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user