Skip to content

Commit

Permalink
gtk: add gtk_css_provider_load_from_resource()
Browse files Browse the repository at this point in the history
  • Loading branch information
x1unix committed Apr 25, 2020
1 parent 7414184 commit 21e0485
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions gtk/gtk_since_3_16.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,3 +313,16 @@ func (v *TextBuffer) InsertMarkup(start *TextIter, text string) {
defer C.free(unsafe.Pointer(cstr))
C.gtk_text_buffer_insert_markup(v.native(), (*C.GtkTextIter)(start), (*C.gchar)(cstr), C.gint(len(text)))
}

/*
* CssProvider
*/

// LoadFromResource is a wrapper around gtk_css_provider_load_from_resource().
//
// See: https://developer.gnome.org/gtk3/stable/GtkCssProvider.html#gtk-css-provider-load-from-resource
func (v *CssProvider) LoadFromResource(path string) {
cpath := C.CString(path)
defer C.free(unsafe.Pointer(cpath))
C.gtk_css_provider_load_from_resource(v.native(), (*C.gchar)(cpath))
}

0 comments on commit 21e0485

Please sign in to comment.