Applied Labels being vertically aligned to the top when next to a Table in the GTK+ backend.

This commit is contained in:
Pietro Gagliardi 2014-07-30 17:32:10 -04:00
parent 3d922c87fa
commit 713be62f16
2 changed files with 8 additions and 4 deletions

View File

@ -81,8 +81,7 @@ func newControl(widget *C.GtkWidget) *controlbase {
C.gtk_widget_size_allocate(c.widget, &r) C.gtk_widget_size_allocate(c.widget, &r)
} }
c.fgetAuxResizeInfo = func(d *sizing) { c.fgetAuxResizeInfo = func(d *sizing) {
//TODO // controls set this to true if a Label to its left should be vertically aligned to the control's top
// d.shouldVAlignTop = (s.ctype == c_listbox) || (s.ctype == c_area)
d.shouldVAlignTop = false d.shouldVAlignTop = false
} }
return c return c

View File

@ -34,6 +34,11 @@ func finishNewTable(b *tablebase, ty reflect.Type) Table {
tablebase: b, tablebase: b,
treeview: (*C.GtkTreeView)(unsafe.Pointer(widget)), treeview: (*C.GtkTreeView)(unsafe.Pointer(widget)),
} }
t.fgetAuxResizeInfo = func(d *sizing) {
// a Label to the left of a Table should be vertically aligned to the top
// TODO do the same with Area
d.shouldVAlignTop = true
}
model := C.newTableModel(unsafe.Pointer(t)) model := C.newTableModel(unsafe.Pointer(t))
t.model = model t.model = model
t.modelgtk = (*C.GtkTreeModel)(unsafe.Pointer(model)) t.modelgtk = (*C.GtkTreeModel)(unsafe.Pointer(model))