aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtk/ScintillaGTK.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2011-05-01 14:44:14 +1000
committernyamatongwe <devnull@localhost>2011-05-01 14:44:14 +1000
commitebaa94a9aeeff5954c6f5fca1db652c0ad0e0460 (patch)
tree133279c838eb6932726f72ba91eff84b8f792c8f /gtk/ScintillaGTK.cxx
parent4246d0084156b71c2ad083b63f390a119e69e72c (diff)
downloadscintilla-mirror-ebaa94a9aeeff5954c6f5fca1db652c0ad0e0460.tar.gz
Use accessor function for allocation and style for GTK+ 3.
Diffstat (limited to 'gtk/ScintillaGTK.cxx')
-rw-r--r--gtk/ScintillaGTK.cxx26
1 files changed, 18 insertions, 8 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index edbdd7a3a..d121326c8 100644
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -394,10 +394,16 @@ void ScintillaGTK::RealizeThis(GtkWidget *widget) {
#endif
GdkWindowAttr attrs;
attrs.window_type = GDK_WINDOW_CHILD;
- attrs.x = widget->allocation.x;
- attrs.y = widget->allocation.y;
- attrs.width = widget->allocation.width;
- attrs.height = widget->allocation.height;
+ GtkAllocation allocation;
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_get_allocation(widget, &allocation);
+#else
+ allocation = widget->allocation;
+#endif
+ attrs.x = allocation.x;
+ attrs.y = allocation.y;
+ attrs.width = allocation.width;
+ attrs.height = allocation.height;
attrs.wclass = GDK_INPUT_OUTPUT;
attrs.visual = gtk_widget_get_visual(widget);
attrs.colormap = gtk_widget_get_colormap(widget);
@@ -634,13 +640,17 @@ void ScintillaGTK::SizeRequest(GtkWidget *widget, GtkRequisition *requisition) {
void ScintillaGTK::SizeAllocate(GtkWidget *widget, GtkAllocation *allocation) {
ScintillaGTK *sciThis = ScintillaFromWidget(widget);
try {
+#if GTK_CHECK_VERSION(2,20,0)
+ gtk_widget_set_allocation(widget, allocation);
+#else
widget->allocation = *allocation;
+#endif
if (IS_WIDGET_REALIZED(widget))
gdk_window_move_resize(WindowFromWidget(widget),
- widget->allocation.x,
- widget->allocation.y,
- widget->allocation.width,
- widget->allocation.height);
+ allocation->x,
+ allocation->y,
+ allocation->width,
+ allocation->height);
sciThis->Resize(allocation->width, allocation->height);