From 726f047655dfed143918fca1539a972aa4738466 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 2 Jun 2014 13:13:16 -0400 Subject: [PATCH] Null-terminated the GtkLayout stylesheet string. This will be handy for consolidating all the GTK+ stylesheet stuff into a single Go-side init function. (Thanks to mischief, nsf, and dsal in irc.badnik.net/#go-nuts for confirming that this is valid.) --- gtkcalls_unix.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtkcalls_unix.go b/gtkcalls_unix.go index 21b46b9..72b0dfe 100644 --- a/gtkcalls_unix.go +++ b/gtkcalls_unix.go @@ -96,14 +96,14 @@ func gtk_window_get_size(window *C.GtkWidget) (int, int) { var gtkLayoutCSS = []byte(`GtkLayout { background-color: transparent; } -`) +` + "\000") func makeTransparent(layout *C.GtkWidget) { var err *C.GError = nil provider := C.gtk_css_provider_new() added := C.gtk_css_provider_load_from_data(provider, - (*C.gchar)(unsafe.Pointer(>kLayoutCSS[0])), C.gssize(len(gtkLayoutCSS)), &err) + (*C.gchar)(unsafe.Pointer(>kLayoutCSS[0])), -1, &err) if added == C.FALSE { message := fromgstr(err.message) panic(fmt.Errorf("error loading transparent background CSS for GtkLayout: %s", message))