compilation fixes for newer GTK versions (patch 1042407)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@29921 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -222,6 +222,7 @@ wxMSW:
|
|||||||
wxGTK:
|
wxGTK:
|
||||||
|
|
||||||
- allow calling wxWindow::SetFont if window not yet created
|
- allow calling wxWindow::SetFont if window not yet created
|
||||||
|
- fixed compilation with newer GTK+ versions
|
||||||
|
|
||||||
wxOS2:
|
wxOS2:
|
||||||
- fixed various problems in file handling
|
- fixed various problems in file handling
|
||||||
|
@@ -30,13 +30,13 @@
|
|||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#define gtk_accel_group_attach(g, o) _gtk_accel_group_attach((g), (o))
|
#define gtk_accel_group_attach(g, o) gtk_window_add_accel_group((o), (g))
|
||||||
#define gtk_accel_group_detach(g, o) _gtk_accel_group_detach((g), (o))
|
#define gtk_accel_group_detach(g, o) gtk_window_remove_accel_group((o), (g))
|
||||||
#define gtk_menu_ensure_uline_accel_group(m) gtk_menu_get_accel_group(m)
|
#define gtk_menu_ensure_uline_accel_group(m) gtk_menu_get_accel_group(m)
|
||||||
|
|
||||||
#define ACCEL_OBJECT GObject
|
#define ACCEL_OBJECT GtkWindow
|
||||||
#define ACCEL_OBJECTS(a) (a)->acceleratables
|
#define ACCEL_OBJECTS(a) (a)->acceleratables
|
||||||
#define ACCEL_OBJ_CAST(obj) G_OBJECT(obj)
|
#define ACCEL_OBJ_CAST(obj) ((GtkWindow*) obj)
|
||||||
#else // GTK+ 1.x
|
#else // GTK+ 1.x
|
||||||
#define ACCEL_OBJECT GtkObject
|
#define ACCEL_OBJECT GtkObject
|
||||||
#define ACCEL_OBJECTS(a) (a)->attach_objects
|
#define ACCEL_OBJECTS(a) (a)->attach_objects
|
||||||
|
@@ -340,9 +340,17 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const gchar *font_name =
|
GtkSettings *settings = gtk_settings_get_default();
|
||||||
_gtk_rc_context_get_default_font_name(gtk_settings_get_default());
|
gchar *font_name = NULL;
|
||||||
g_systemFont = new wxFont(wxString::FromAscii(font_name));
|
g_object_get ( settings,
|
||||||
|
"gtk-font-name",
|
||||||
|
&font_name,
|
||||||
|
NULL);
|
||||||
|
if (!font_name)
|
||||||
|
g_systemFont = new wxFont( 12, wxSWISS, wxNORMAL, wxNORMAL );
|
||||||
|
else
|
||||||
|
g_systemFont = new wxFont(wxString::FromAscii(font_name));
|
||||||
|
g_free (font_name);
|
||||||
}
|
}
|
||||||
gtk_widget_destroy( widget );
|
gtk_widget_destroy( widget );
|
||||||
#else
|
#else
|
||||||
|
@@ -30,13 +30,13 @@
|
|||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#define gtk_accel_group_attach(g, o) _gtk_accel_group_attach((g), (o))
|
#define gtk_accel_group_attach(g, o) gtk_window_add_accel_group((o), (g))
|
||||||
#define gtk_accel_group_detach(g, o) _gtk_accel_group_detach((g), (o))
|
#define gtk_accel_group_detach(g, o) gtk_window_remove_accel_group((o), (g))
|
||||||
#define gtk_menu_ensure_uline_accel_group(m) gtk_menu_get_accel_group(m)
|
#define gtk_menu_ensure_uline_accel_group(m) gtk_menu_get_accel_group(m)
|
||||||
|
|
||||||
#define ACCEL_OBJECT GObject
|
#define ACCEL_OBJECT GtkWindow
|
||||||
#define ACCEL_OBJECTS(a) (a)->acceleratables
|
#define ACCEL_OBJECTS(a) (a)->acceleratables
|
||||||
#define ACCEL_OBJ_CAST(obj) G_OBJECT(obj)
|
#define ACCEL_OBJ_CAST(obj) ((GtkWindow*) obj)
|
||||||
#else // GTK+ 1.x
|
#else // GTK+ 1.x
|
||||||
#define ACCEL_OBJECT GtkObject
|
#define ACCEL_OBJECT GtkObject
|
||||||
#define ACCEL_OBJECTS(a) (a)->attach_objects
|
#define ACCEL_OBJECTS(a) (a)->attach_objects
|
||||||
|
@@ -340,9 +340,17 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const gchar *font_name =
|
GtkSettings *settings = gtk_settings_get_default();
|
||||||
_gtk_rc_context_get_default_font_name(gtk_settings_get_default());
|
gchar *font_name = NULL;
|
||||||
g_systemFont = new wxFont(wxString::FromAscii(font_name));
|
g_object_get ( settings,
|
||||||
|
"gtk-font-name",
|
||||||
|
&font_name,
|
||||||
|
NULL);
|
||||||
|
if (!font_name)
|
||||||
|
g_systemFont = new wxFont( 12, wxSWISS, wxNORMAL, wxNORMAL );
|
||||||
|
else
|
||||||
|
g_systemFont = new wxFont(wxString::FromAscii(font_name));
|
||||||
|
g_free (font_name);
|
||||||
}
|
}
|
||||||
gtk_widget_destroy( widget );
|
gtk_widget_destroy( widget );
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user