Fix wxWebViewWebKit build with WebKit2 < 2.8

This allows this code to be compiled with WebKit2 2.6 included in Debian
Jessie.

Closes https://github.com/wxWidgets/wxWidgets/pull/519
This commit is contained in:
Vadim Zeitlin
2017-07-15 18:41:47 +02:00
parent 88a767773f
commit a43e25c3d6
2 changed files with 18 additions and 0 deletions

View File

@@ -950,14 +950,23 @@ bool wxWebViewWebKit::IsBusy() const
void wxWebViewWebKit::SetEditable(bool enable)
{
#if WEBKIT_CHECK_VERSION(2, 8, 0)
webkit_web_view_set_editable(m_web_view, enable);
#else
// Not supported in older versions.
wxUnusedVar(enable);
#endif
}
bool wxWebViewWebKit::IsEditable() const
{
#if WEBKIT_CHECK_VERSION(2, 8, 0)
gboolean editable;
g_object_get(m_web_view, "editable", &editable, NULL);
return editable != 0;
#else
return false;
#endif
}
void wxWebViewWebKit::DeleteSelection()