 
 public extension CssProviderProtocol {
     /// Return the CSS provider as a style provider
-    public var styleProvider: StyleProviderRef { return StyleProviderRef(cPointer: ptr) }
+    public var styleProvider: StyleProviderRef {
+        return StyleProviderRef(cPointer: ptr.withMemoryRebound(to: GTypeInstance.self, capacity: 1) {
+            g_type_check_instance_cast($0, gtk_style_provider_get_type())
+        })
+    }
 
     /// Loads the data provided in the given string into the CSS Provider
     ///

//  Created by Rene Hexel on 25/4/17.
//  Copyright © 2017 Rene Hexel.  All rights reserved.
//
import CGtk

fileprivate let string: (UnsafePointer<CChar>) -> UnsafeMutablePointer<CChar> = { UnsafeMutablePointer(mutating: $0) }

/// CSS Provider reference
public typealias CSSProviderRef = CssProvider

    /// - Throws: an `ErrorType` if there is an issue with the CSS
    @discardableResult
    public func load(from data: String) throws -> Bool {
        return try with(gString: data) {
            return try loadFrom(data: $0, length: -1)
        }
    }
}

