From de273046a408ea25a82f5f6de2c62a2e02a15749 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Tue, 19 Dec 2017 10:42:47 -0800 Subject: [PATCH] Avoid gtk_entry_{get,set}_inner_border() with GTK+4 --- src/gtk/textentry.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gtk/textentry.cpp b/src/gtk/textentry.cpp index 7725a45800..966d9b9153 100644 --- a/src/gtk/textentry.cpp +++ b/src/gtk/textentry.cpp @@ -521,7 +521,7 @@ bool wxTextEntry::GTKEntryOnInsertText(const char* text) bool wxTextEntry::DoSetMargins(const wxPoint& margins) { -#if GTK_CHECK_VERSION(2,10,0) +#if GTK_CHECK_VERSION(2,10,0) && !defined(__WXGTK4__) GtkEntry* entry = GetEntry(); if ( !entry ) @@ -529,6 +529,7 @@ bool wxTextEntry::DoSetMargins(const wxPoint& margins) if ( !wx_is_at_least_gtk2(10) ) return false; + wxGCC_WARNING_SUPPRESS(deprecated-declarations) const GtkBorder* oldBorder = gtk_entry_get_inner_border(entry); GtkBorder newBorder; @@ -553,6 +554,7 @@ bool wxTextEntry::DoSetMargins(const wxPoint& margins) newBorder.top = margins.y; gtk_entry_set_inner_border(entry, &newBorder); + wxGCC_WARNING_RESTORE() return true; #else @@ -564,13 +566,15 @@ bool wxTextEntry::DoSetMargins(const wxPoint& margins) wxPoint wxTextEntry::DoGetMargins() const { wxPoint point(-1, -1); -#if GTK_CHECK_VERSION(2,10,0) +#if GTK_CHECK_VERSION(2,10,0) && !defined(__WXGTK4__) GtkEntry* entry = GetEntry(); if (entry) { if (wx_is_at_least_gtk2(10)) { + wxGCC_WARNING_SUPPRESS(deprecated-declarations) const GtkBorder* border = gtk_entry_get_inner_border(entry); + wxGCC_WARNING_RESTORE() if (border) { point.x = border->left;