From 13d4e1d258359b0c45df95ea0c359bd50e07ef85 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 16 Feb 2014 18:57:50 -0500 Subject: Added the GTK+ equivalent of Window.Title() and Button.Text() in preparation for adding the GTK+ implementation of Combobox. --- gtkcalls_unix.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gtkcalls_unix.go') 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())) } -- cgit v1.2.3