conformal/gotk3 — pull request #26 by solusipse (2013-11-30 05:58:24+00:00)
Title: added basic support of GtkCssProvider

Simple example with gradient background:

```
package main

import (
"github.com/conformal/gotk3/gtk"
"github.com/conformal/gotk3/gdk"
"log"
)

func main() {
// Initialize GTK without parsing any command line arguments.
gtk.Init(nil)

// Create a new toplevel window, set its title, and connect it to the
// "destroy" signal to exit the GTK main loop when it is destroyed.
win, err := gtk.WindowNew(gtk.WINDOW_TOPLEVEL)
if err != nil {
log.Fatal("Unable to create window:", err)
}
win.SetTitle("Simple Example")
win.Connect("destroy", func() {
gtk.MainQuit()
})

// Create a new label widget to show in the window.
l, err := gtk.LabelNew("Hello, gotk3!")
if err != nil {
log.Fatal("Unable to create label:", err)
}

// Add the label to the window.
win.Add(l)

// Set the default window size.
win.SetDefaultSize(800, 600)

provider, _ := gtk.NewCssProvider()
display, _ := gdk.DisplayGetDefault()
screen, _ := display.GetDefaultScreen()

provider.AddToScreen(screen)
provider.LoadFromData(" GtkWindow {background: -gtk-gradient (linear,0 0,0 1,color-stop(0, #333),color-stop(0.2, #666))}")

// Recursively show all widgets contained in this window.
win.ShowAll()

// Begin executing the GTK main loop. This blocks until
// gtk.MainQuit() is run.
gtk.Main()
}
```