summaryrefslogtreecommitdiff
path: root/redo/tab_unix.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-03 16:28:21 -0400
committerPietro Gagliardi <[email protected]>2014-08-03 16:28:21 -0400
commitb6d07237b423b690570e105e5f0810d35693b0d0 (patch)
treefdf2f0ec2a66f217080dfeb0b60de9e763a9bd95 /redo/tab_unix.go
parentfd48be68ee957e936c272348d3f0b0bddaba5c92 (diff)
Migrated the GTK+ backend to the new Control system. Added controlParent to deal with interface issues; need to apply this to the Windows backend too.
Diffstat (limited to 'redo/tab_unix.go')
-rw-r--r--redo/tab_unix.go35
1 files changed, 33 insertions, 2 deletions
diff --git a/redo/tab_unix.go b/redo/tab_unix.go
index 60978ea..ba7d106 100644
--- a/redo/tab_unix.go
+++ b/redo/tab_unix.go
@@ -12,7 +12,7 @@ import (
import "C"
type tab struct {
- *controlbase
+ _widget *C.GtkWidget
notebook *C.GtkNotebook
tabs []*layout
@@ -21,7 +21,7 @@ type tab struct {
func newTab() Tab {
widget := C.gtk_notebook_new()
t := &tab{
- controlbase: newControl(widget),
+ _widget: widget,
notebook: (*C.GtkNotebook)(unsafe.Pointer(widget)),
}
// there are no scrolling arrows by default; add them in case there are too many tabs
@@ -42,4 +42,35 @@ func (t *tab) Append(name string, control Control) {
}
}
+func (t *tab) widget() *C.GtkWidget {
+ return t._widget
+}
+
+func (t *tab) setParent(p *controlParent) {
+ basesetParent(t, p)
+}
+
+func (t *tab) containerShow() {
+ basecontainerShow(t)
+}
+
+func (t *tab) containerHide() {
+ basecontainerHide(t)
+}
+
+func (t *tab) allocate(x int, y int, width int, height int, d *sizing) []*allocation {
+ return baseallocate(t, x, y, width, height, d)
+}
+
+func (t *tab) preferredSize(d *sizing) (width, height int) {
+ return basepreferredSize(t, d)
+}
+
// no need to override Control.commitResize() as only prepared the tabbed control; its children will be reallocated when that one is resized
+func (t *tab) commitResize(a *allocation, d *sizing) {
+ basecommitResize(t, a, d)
+}
+
+func (t *tab) getAuxResizeInfo(d *sizing) {
+ basegetAuxResizeInfo(d)
+}