Hello colleagues,

On Sunday, September 7, 2014 2:21:15 PM UTC+2, Shashi Gowda wrote:
>
> Tim, is there a way to show Compose output in ImageView? Will be nice to 
> have SVG rendering - that's the fastest Compose backend. It would also let 
> Gadfly plots show up.
>

Compose (as most of the drawing is done via Cairo Surfaces anyway) has the 
option to draw/render into an available Cairo Surface. 
With that and a few lines of Gtk definitions you can paint Gadfly on screen.


julia> using Gtk

julia> using Gadfly

julia> using Compose

julia> p = plot(x=rand(40,1),y=rand(40,1));

julia> co = render(p);

julia> c = Gtk.@GtkCanvas(400,300);

julia> w = Gtk.@GtkWindow(c,"data win");

julia> show(c);

julia> Gtk.draw(c) do widget
       Compose.draw(CAIROSURFACE(c.back),co)
       end

gives me a plot into a resizable Gtk Window.

The replotting is not super-fast, so it's not suited to animations.

Reply via email to