diff options
| author | Pietro Gagliardi <[email protected]> | 2014-10-18 17:03:07 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-10-18 17:03:07 -0400 |
| commit | 62048303a34f6cac733798651adb53b640e2114a (patch) | |
| tree | b03994dfe1d5cfbc94be65075f3345a45166bbef /textfield_unix.go | |
| parent | 8c8b642adbed274133b6e9d975c7ca8786300d2c (diff) | |
Merged new container/sizing stuff.
Diffstat (limited to 'textfield_unix.go')
| -rw-r--r-- | textfield_unix.go | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/textfield_unix.go b/textfield_unix.go index 33898d3..6535d39 100644 --- a/textfield_unix.go +++ b/textfield_unix.go @@ -18,7 +18,7 @@ import ( import "C" type textfield struct { - _widget *C.GtkWidget + *controlSingleWidget entry *C.GtkEntry changed *event } @@ -26,12 +26,12 @@ type textfield struct { func startNewTextField() *textfield { widget := C.gtk_entry_new() t := &textfield{ - _widget: widget, + controlSingleWidget: newControlSingleWidget(widget), entry: (*C.GtkEntry)(unsafe.Pointer(widget)), 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 @@ -79,27 +79,3 @@ func textfieldChanged(editable *C.GtkEditable, data C.gpointer) { t := (*textfield)(unsafe.Pointer(data)) t.changed.fire() } - -func (t *textfield) widget() *C.GtkWidget { - return t._widget -} - -func (t *textfield) setParent(p *controlParent) { - basesetParent(t, p) -} - -func (t *textfield) allocate(x int, y int, width int, height int, d *sizing) []*allocation { - return baseallocate(t, x, y, width, height, d) -} - -func (t *textfield) preferredSize(d *sizing) (width, height int) { - return basepreferredSize(t, d) -} - -func (t *textfield) commitResize(a *allocation, d *sizing) { - basecommitResize(t, a, d) -} - -func (t *textfield) getAuxResizeInfo(d *sizing) { - basegetAuxResizeInfo(t, d) -} |
