summaryrefslogtreecommitdiff
path: root/newctrl/container_unix.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-10-18 08:57:53 -0400
committerPietro Gagliardi <[email protected]>2014-10-18 08:57:53 -0400
commit45acb35a6d89c2e7c7d2233f3613d04253f88922 (patch)
treef01291c519c387510ef05d7a8f0131dafebeb0a6 /newctrl/container_unix.go
parent772f03f4b3d4fb45ee0359af7742effdcee8a557 (diff)
Fixed control positioning on GTK+. This will also "fix" control positioning on Windows; next commit.
Diffstat (limited to 'newctrl/container_unix.go')
-rw-r--r--newctrl/container_unix.go9
1 files changed, 9 insertions, 0 deletions
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