diff options
| author | Pietro Gagliardi <[email protected]> | 2014-10-17 20:02:34 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-10-17 20:02:34 -0400 |
| commit | 8f1165e0c7246a1faec655088004cce8c5e047d7 (patch) | |
| tree | 961c5712ff842e10121958f04d8ada57533221b7 /newctrl/area_unix.go | |
| parent | 344a344abd471e36ebd6ea0ced71df1ce74ea189 (diff) | |
Did most of the GTK+ migration.
Diffstat (limited to 'newctrl/area_unix.go')
| -rw-r--r-- | newctrl/area_unix.go | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/newctrl/area_unix.go b/newctrl/area_unix.go index 01e604c..fd17bc0 100644 --- a/newctrl/area_unix.go +++ b/newctrl/area_unix.go @@ -34,9 +34,8 @@ import "C" type area struct { *areabase - _widget *C.GtkWidget + *scroller drawingarea *C.GtkDrawingArea - scroller *scroller clickCounter *clickCounter @@ -59,7 +58,6 @@ func newArea(ab *areabase) Area { textfieldw := C.gtk_entry_new() a := &area{ areabase: ab, - _widget: widget, drawingarea: (*C.GtkDrawingArea)(unsafe.Pointer(widget)), scroller: newScroller(widget, false, false, true), // not natively scrollable; no border; have an overlay for OpenTextFieldAt() clickCounter: new(clickCounter), @@ -67,6 +65,7 @@ func newArea(ab *areabase) Area { textfield: (*C.GtkEntry)(unsafe.Pointer(textfieldw)), textfielddone: newEvent(), } + a.fpreferredSize = a.preferredSize for _, c := range areaCallbacks { g_signal_connect( C.gpointer(unsafe.Pointer(a.drawingarea)), @@ -492,28 +491,7 @@ var modonlykeys = map[C.guint]Modifiers{ C.GDK_KEY_Super_R: Super, } -func (a *area) widget() *C.GtkWidget { - return a._widget -} - -func (a *area) setParent(p *controlParent) { - a.scroller.setParent(p) -} - -func (a *area) allocate(x int, y int, width int, height int, d *sizing) []*allocation { - return baseallocate(a, x, y, width, height, d) -} - func (a *area) preferredSize(d *sizing) (width, height int) { // the preferred size of an Area is its size return a.width, a.height } - -func (a *area) commitResize(c *allocation, d *sizing) { - a.scroller.commitResize(c, d) -} - -func (a *area) getAuxResizeInfo(d *sizing) { - // a Label to the left of an Area should be vertically aligned to the top - d.shouldVAlignTop = true -} |
