diff --git a/src/theme.jl b/src/theme.jl index 0ae6053d..ff1fcea0 100644 --- a/src/theme.jl +++ b/src/theme.jl @@ -15,7 +15,7 @@ function GtkCssProviderLeaf(;data=nothing,filename=nothing) elseif filename !== nothing GError() do error_check ccall((:gtk_css_provider_load_from_path,libgtk), Bool, - (Ptr{GObject}, Ptr{UInt8}, Clong, Ptr{Ptr{GError}}), + (Ptr{GObject}, Ptr{UInt8}, Ptr{Ptr{GError}}), provider, bytestring(filename), error_check) end end diff --git a/test/gui.jl b/test/gui.jl index 8729a080..b18fdc39 100644 --- a/test/gui.jl +++ b/test/gui.jl @@ -564,3 +564,25 @@ str = takebuf_string(io) @assert str == "scrolling\n" destroy(w) + +# CSS + +## CssProviderLeaf(filename="...") + +style_file = "style_test.css" + +l = @Label "I am some large blue text!" +w = @Window(l) + +screen = Gtk.GAccessor.screen(w) +provider = CssProviderLeaf(filename=style_file) + +ccall((:gtk_style_context_add_provider_for_screen, Gtk.libgtk), Void, + (Ptr{Void}, Ptr{GObject}, Cuint), + screen, provider, 1) + +showall(w) + +### add css tests here + +destroy(w) diff --git a/test/style_test.css b/test/style_test.css new file mode 100644 index 00000000..220f7eb2 --- /dev/null +++ b/test/style_test.css @@ -0,0 +1,4 @@ +GtkLabel { + color: blue; + font: 16px; +}