Avoid GTK warning "invalid cast from 'GtkTextView' to 'GtkEntry'" when using SetHint()

closes #16321
This commit is contained in:
Paul Cornett
2015-05-20 23:12:17 -07:00
parent 5f8ac45789
commit f583ba0ffb
2 changed files with 5 additions and 2 deletions

View File

@@ -851,7 +851,10 @@ GtkEditable *wxTextCtrl::GetEditable() const
GtkEntry *wxTextCtrl::GetEntry() 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 int wxTextCtrl::GTKIMFilterKeypress(GdkEventKey* event) const

View File

@@ -521,7 +521,7 @@ bool wxTextEntry::SetHint(const wxString& hint)
{ {
#if GTK_CHECK_VERSION(3,2,0) #if GTK_CHECK_VERSION(3,2,0)
GtkEntry *entry = GetEntry(); 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)); gtk_entry_set_placeholder_text(entry, wxGTK_CONV(hint));
return true; return true;