This package is in a VERY EARLY development state! You need rust installed if you want to try it out
Slint GUI for Julia
- Rust
- Visual Studio Community 2017 (or later) with C++ Build Tools ( see below )
using Pkg
Pkg.add(url="https://github.com/oheil/Slint.jl.git") # build errors (see below) should be resolved now
On Windows, packages are added to folders like .julia\packages\Slint\uZ1Dp\
. All folders have full access rights for the current user, but files only have restricted access rights, typically read only. This prevents the build process to succeed because some build artefacts need to be overwritten during build which will fail because of insufficient access rights.
In this case the problematic file is
.julia\packages\Slint\uZ1Dp\deps\SlintWrapper\include\slintwrapper.h
and a solution will be found at some time.
using Slint
cd(joinpath(dirname(pathof(Slint)), ".."))
include("examples\\7guis\\booker.jl")
include("examples\\7guis\\cells.jl")
include("examples\\7guis\\circledraw.jl")
include("examples\\7guis\\counter.jl")
using Pkg
Pkg.develop("Slint")
using Pkg
cd(".julia/dev/Slint")
Pkg.activate(".")
Pkg.build("Slint"; verbose = true);
include("contrib\\generator.jl")
include("examples\\7guis\\crud.jl")
using Slint
s = "export component MyWin inherits Window {
Text {
text: \"Hello, World\";
}
}
"
Slint.compile_from_string(s,"MyWin")
Slint.run()
using Slint
file1 = "examples\\7guis\\booker.slint"
file2 = "helloworld.slint"
file3 = "SingleButton.slint"
Slint.compile_from_file(file1,"Booker")
#setting callbacks needs to be before the next call to CompileFromFile
Slint.compile_from_file(file2,"Demo")
#after last command no callback can be set for file1 anymore!
function print_callback()
println("Button clicked, Julia responded")
end
Slint.set_callback("button-clicked",print_callback)
Slint.compile_from_file(file3,"SingleButton")
Slint.run()