From 45acb35a6d89c2e7c7d2233f3613d04253f88922 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 18 Oct 2014 08:57:53 -0400 Subject: Fixed control positioning on GTK+. This will also "fix" control positioning on Windows; next commit. --- newctrl/container_unix.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'newctrl/container_unix.go') diff --git a/newctrl/container_unix.go b/newctrl/container_unix.go index 4284f21..90bc84b 100644 --- a/newctrl/container_unix.go +++ b/newctrl/container_unix.go @@ -50,6 +50,15 @@ func (c *container) allocation(margined bool) C.GtkAllocation { return a } +// we can just return these values as is +// note that allocations of a widget on GTK+ have their origin in the /window/ origin +func (c *container) bounds(d *sizing) (int, int, int, int) { + var a C.GtkAllocation + + C.gtk_widget_get_allocation(c.widget, &a) + return int(a.x), int(a.y), int(a.width), int(a.height) +} + const ( gtkXMargin = 12 gtkYMargin = 12 -- cgit v1.2.3