Skip to content

Instantly share code, notes, and snippets.

@vojtechtrefny
Created April 11, 2016 12:20
Show Gist options
  • Save vojtechtrefny/a0e8bb64980cc10d992fe7ec39d19dd9 to your computer and use it in GitHub Desktop.
Save vojtechtrefny/a0e8bb64980cc10d992fe7ec39d19dd9 to your computer and use it in GitHub Desktop.
using Gtk;
using Gdk;
public class MyButton : Gtk.RadioButton {
static construct {
set_css_name ("mybutton");
}
}
int main (string[] args) {
Gtk.init (ref args);
var window = new Gtk.Window ();
string css = """
mybutton {
border: solid 6px red;
}
""";
var provider = new Gtk.CssProvider ();
provider.load_from_data (css, css.length);
var screen = Gdk.Screen.get_default ();
Gtk.StyleContext.add_provider_for_screen(screen, provider, Gtk.STYLE_PROVIDER_PRIORITY_USER);
var button = new MyButton ();
window.add (button);
window.destroy.connect (Gtk.main_quit);
window.show_all ();
Gtk.main ();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment