I would definately use Julia's timers. See `Gtk.jl/src/cairo.jl` for an example interface to the Cairo backing to a Gtk window (used in `Winston.jl/src/gtk.jl`). If you are using this wrapper, call `draw(w)` to force a redraw immediately, or `draw(w,false)` to queue a redraw request for when Gtk is idle.
On Mon, Jun 16, 2014 at 9:12 PM, Tim Holy <[email protected]> wrote: > ImageView's navigation.jl contains an example. The default branch is Tk > (because as far as binary distribution goes, Tk is "solved" and Gtk isn't > yet), but it has a gtk branch you can look at. > > --Tim > > On Monday, June 16, 2014 04:01:46 PM Abe Schneider wrote: > > I was looking for a way to display a simulation in Julia. Originally I > was > > going to just use PyPlot, but it occurred to me it would be better to > just > > use Gtk+ + Cairo to do the drawing rather than something whose main > purpose > > is drawing graphs. > > > > So far, following the examples on the Github page, I have no problem > > creating a window with a Cairo canvas. I can also display content on the > > canvas fairly easily (which speaks volumes on the awesomeness of Julia > and > > the Gtk+ library). However, after looking through the code and samples, > > it's not obvious to me how to redraw the canvas every fraction of a > second > > to display new content. > > > > I did find an example of animating with Cairo and Gtk+ in C > > (http://cairographics.org/threaded_animation_with_cairo/). However, I > > assume one would want to use Julia's timers instead of of GLibs? > Secondly, > > there in their function 'timer_exe', call is made directly to Gtk+ to > send > > a redraw queue to the window. Is there a cleaner way to do it with the > Gtk+ > > library? > > > > Thanks! > > A > >
