jverzani / gtkinteract.jl Goto Github PK
View Code? Open in Web Editor NEWPort of Interact.jl functionality with Gtk
License: Other
Port of Interact.jl functionality with Gtk
License: Other
To make a button with a callback utilizes a pattern like
b = button("click me")
window(b)
map(b) do args...
println("clicked me")
end
All good, but if things get more complicated, the button fails to be lifted:
window(toolbar(b), grow(b))
Now clicking on b
does not update the GUI (any of the three instances)
Also directly pushing a value doesn't work, though this will at first:
push!(b.signal, nothing)
Not sure what happens here...
In #10 it was pointed out this is not working. The issue lies in the relationship between Gtk and Reactive and is reported here: JuliaGraphics/Gtk.jl#229
Until that gets sorted out, this package will only work with older commits, such as can be done through Pkg.pin
.
I tried with Immerse, inspectDR and Gadfly to add a image in a window with widgets, for example sliders.
When i use the slider i get this error:
MethodError: no methiod matchin update_view.
For example, this code from examples:
w = mainwindow(title="Simple test")
n = slider(1:10, label="n")
m = slider(11:20, label="m")
cg = cairographic()
append!(w, [n, m, cg])
map(n,m) do n,m
push!(cg, plot(sin, n*pi, m*pi))
end
Can you show me an example. A simple one, for example a plot of a function that changes in real time when you move the slider. It would be nice if you tell me packages versions.
Thanks.
I have a program, which could run for a very long time and generate a lot of pictures associated with different parameters. I want to use GtkInteract to visualize those pictures by
using GtkInteract,ImageView
@manipulate for a=1:10, b=1:10, c=1:10
img=imread("...")
view(img)
end
Is it difficult to integrate ImageView into GtkInteract? Or could you suggest other methods to achieve this?
Thanks
I tried the @manipulate
example in the README and got the following error:
ERROR: MethodError: `display` has no method matching display(::Gtk.GtkCanvas, ::Winston.FramedPlot)
Closest candidates are:
display(::AbstractString, ::Any)
display(::TextDisplay, ::Any)
display(::MIME{mime}, ::Any)
I was trying to get this package to work with Immerse using the following flow, but had some problems. There may be simpler implementations of this, but I have found none that works with multiple plots and sliders/checkboxes (feel free to give me some pointers if there is). Below follows a toy example:
using GtkInteract, Immerse
k = slider(1:0.1:10)
cg1 = cairographic(width=200,height=150)
w = window(hbox(k,grow(cg1)))
Reactive.preserve(map(k) do k
fig1 = Immerse.plot(y=(1:10).^k)
push!(cg1, fig1)
end)
w
The code above doesn't work, but I was able to create a solution.
Would you consider adding the following function to the package? (I can create a pull request, but wanted to know if I'm using the package correctly first)
function Base.push!(obj::CairoGraphic, p::Gadfly.Plot)
if obj.obj != nothing
push!(obj.obj, p)
end
end
The problem that the old image doesn't disappear is still present. This can be easily solved by adding a backgound to the plot:
fig1 = Immerse.plot(y=(1:10).^k, Theme(background_color=Colors.RGB(1.,1.,1.)))
is there a way to generalize this or solve it in some other way?
JuliaGizmos/Reactive.jl#65 was a big (and likely breaking) change that just got merged. Once it gets tagged (CC @shashi), this will likely need updating. I might be able to help, but first some questions:
Is this package still being developed?
It doesn't seem to work for me on Fedora 22 with julia 0.4.5. I simply get either a completely black or completely transparent window depending on which window manager I use.
using GtkInteract
w = mainwindow(title="Simple test")
n = slider(1:10, label="n")
m = slider(11:20, label="m")
cg = cairographic(); # without the trailing ';', a StackOverflowError occurs
# because it does not know how to show(cg)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.