diff options
| author | Pietro Gagliardi <[email protected]> | 2014-02-16 18:57:50 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-02-16 18:57:50 -0500 |
| commit | 13d4e1d258359b0c45df95ea0c359bd50e07ef85 (patch) | |
| tree | 785a398fbd40febec2642ed23a92657bbafe6e72 /gtkcalls_unix.go | |
| parent | 161e874d8ab7842b3340f5c14afaf661f75f2ad7 (diff) | |
Added the GTK+ equivalent of Window.Title() and Button.Text() in preparation for adding the GTK+ implementation of Combobox.
Diffstat (limited to 'gtkcalls_unix.go')
| -rw-r--r-- | gtkcalls_unix.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gtkcalls_unix.go b/gtkcalls_unix.go index aba4732..642b34b 100644 --- a/gtkcalls_unix.go +++ b/gtkcalls_unix.go @@ -15,6 +15,8 @@ import ( // void gSignalConnect(GtkWidget *widget, char *signal, GCallback callback, void *data) { g_signal_connect(widget, signal, callback, data); } import "C" +// BIG TODO reduce the amount of explicit casting + type ( gtkWidget C.GtkWidget ) @@ -76,6 +78,10 @@ func gtk_window_set_title(window *gtkWidget, title string) { (*C.gchar)(unsafe.Pointer(ctitle))) } +func gtk_window_get_title(window *gtkWidget) string { + return C.GoString((*C.char)(unsafe.Pointer(C.gtk_window_get_title((*C.GtkWindow)(unsafe.Pointer(window)))))) +} + func gtk_window_resize(window *gtkWidget, width int, height int) { C.gtk_window_resize((*C.GtkWindow)(unsafe.Pointer(window)), C.gint(width), C.gint(height)) } @@ -115,6 +121,10 @@ func gtk_button_set_label(button *gtkWidget, label string) { (*C.gchar)(unsafe.Pointer(clabel))) } +func gtk_button_get_label(button *gtkWidget) string { + return C.GoString((*C.char)(unsafe.Pointer(C.gtk_button_get_label((*C.GtkButton)(unsafe.Pointer(button)))))) +} + func gtk_check_button_new() *gtkWidget { return (*gtkWidget)(unsafe.Pointer(C.gtk_check_button_new())) } |
