diff --git a/newctrl/area_unix.go b/newctrl/area_unix.go index fd17bc0..c865d6b 100644 --- a/newctrl/area_unix.go +++ b/newctrl/area_unix.go @@ -102,7 +102,7 @@ func newArea(ab *areabase) Area { func (a *area) SetSize(width, height int) { a.width = width a.height = height - C.gtk_widget_set_size_request(a._widget, C.gint(a.width), C.gint(a.height)) + C.gtk_widget_set_size_request(a.widget, C.gint(a.width), C.gint(a.height)) } func (a *area) Repaint(r image.Rectangle) { @@ -110,11 +110,11 @@ func (a *area) Repaint(r image.Rectangle) { if r.Empty() { return } - C.gtk_widget_queue_draw_area(a._widget, C.gint(r.Min.X), C.gint(r.Min.Y), C.gint(r.Dx()), C.gint(r.Dy())) + C.gtk_widget_queue_draw_area(a.widget, C.gint(r.Min.X), C.gint(r.Min.Y), C.gint(r.Dx()), C.gint(r.Dy())) } func (a *area) RepaintAll() { - C.gtk_widget_queue_draw(a._widget) + C.gtk_widget_queue_draw(a.widget) } func (a *area) OpenTextFieldAt(x, y int) { diff --git a/newctrl/container_unix.go b/newctrl/container_unix.go index 7169d44..4284f21 100644 --- a/newctrl/container_unix.go +++ b/newctrl/container_unix.go @@ -42,10 +42,10 @@ func (c *container) allocation(margined bool) C.GtkAllocation { C.gtk_widget_get_allocation(c.widget, &a) if margined { - a.x += C.gint(gtkXMargin) - a.y += C.gint(gtkYMargin) - a.width -= C.gint(gtkXMargin) * 2 - a.height -= C.gint(gtkYMargin) * 2 + a.x += C.int(gtkXMargin) + a.y += C.int(gtkYMargin) + a.width -= C.int(gtkXMargin) * 2 + a.height -= C.int(gtkYMargin) * 2 } return a } @@ -59,9 +59,7 @@ const ( func (w *window) beginResize() (d *sizing) { d = new(sizing) - if spaced { - d.xpadding = gtkXPadding - d.ypadding = gtkYPadding - } + d.xpadding = gtkXPadding + d.ypadding = gtkYPadding return d } diff --git a/newctrl/control_unix.go b/newctrl/control_unix.go index cec2061..ca4501b 100644 --- a/newctrl/control_unix.go +++ b/newctrl/control_unix.go @@ -114,7 +114,7 @@ func newScroller(widget *C.GtkWidget, native bool, bordered bool, overlay bool) s.overlay = newControlSingleWidget(s.overlaywidget) s.fsetParent = s.overlay.fsetParent s.fresize = s.overlay.fresize - C.gtk_container_add(s.overlaycontainer, s.scrollcontainer) + C.gtk_container_add(s.overlaycontainer, s.scrollwidget) } return s diff --git a/newctrl/group_unix.go b/newctrl/group_unix.go index 2078ffc..dc6191b 100644 --- a/newctrl/group_unix.go +++ b/newctrl/group_unix.go @@ -50,7 +50,7 @@ func newGroup(text string, control Control) Group { C.gtk_label_set_attributes(label, boldlist) C.pango_attr_list_unref(boldlist) // thanks baedert in irc.gimp.net/#gtk+ - g.container = newContainer(control) + g.container = newContainer() g.child.setParent(g.container.parent()) g.container.setParent(&controlParent{g.gcontainer}) @@ -80,7 +80,7 @@ func (g *group) SetMargined(margined bool) { func (g *group) resize(x int, y int, width int, height int, d *sizing) { // first, chain up to change the GtkFrame and its child container // TODO use a variable for this - g.containerSingleWidget.resize(x, y, width, height, d) + g.controlSingleWidget.resize(x, y, width, height, d) // now that the container has the correct size, we can resize the child a := g.container.allocation(g.margined) diff --git a/newctrl/tab_unix.go b/newctrl/tab_unix.go index 6aae6a5..608e3a6 100644 --- a/newctrl/tab_unix.go +++ b/newctrl/tab_unix.go @@ -34,7 +34,7 @@ func newTab() Tab { } func (t *tab) Append(name string, control Control) { - c := newContainer(control) + c := newContainer() t.tabs = append(t.tabs, c) // this calls gtk_container_add(), which, according to gregier in irc.gimp.net/#gtk+, acts just like gtk_notebook_append_page() c.setParent(&controlParent{t.container}) @@ -51,11 +51,11 @@ func (t *tab) Append(name string, control Control) { func (t *tab) resize(x int, y int, width int, height int, d *sizing) { // first, chain up to change the GtkFrame and its child container // TODO use a variable for this - t.containerSingleWidget.resize(x, y, width, height, d) + t.controlSingleWidget.resize(x, y, width, height, d) // now that the containers have the correct size, we can resize the children for i, _ := range t.tabs { - a := g.tabs[i].allocation(g.margined) - g.children[i].resize(int(a.x), int(a.y), int(a.width), int(a.height), d) + a := t.tabs[i].allocation(false/*TODO*/) + t.children[i].resize(int(a.x), int(a.y), int(a.width), int(a.height), d) } } diff --git a/newctrl/textfield_unix.go b/newctrl/textfield_unix.go index 286ad3f..6535d39 100644 --- a/newctrl/textfield_unix.go +++ b/newctrl/textfield_unix.go @@ -31,7 +31,7 @@ func startNewTextField() *textfield { changed: newEvent(), } g_signal_connect( - C.gpointer(unsafe.Pointer(t._widget)), + C.gpointer(unsafe.Pointer(t.widget)), "changed", C.GCallback(C.textfieldChanged), C.gpointer(unsafe.Pointer(t))) @@ -71,7 +71,7 @@ func (t *textfield) Invalid(reason string) { creason := togstr(reason) defer freegstr(creason) C.gtk_entry_set_icon_tooltip_text(t.entry, C.GTK_ENTRY_ICON_SECONDARY, creason) - C.gtk_widget_error_bell(t._widget) + C.gtk_widget_error_bell(t.widget) } //export textfieldChanged