The Gtk2SVG gem now allows the rendered SVG to be updated

require 'gtk2svg'

s =<<SVG
<svg width="400" height="110">
   <line x1="0" y1="0" x2="200" y2="200" style="stroke:rgb(255,0,0);stroke-width:2" />
</svg>
SVG

app = Gtk2SVG::Main.new s

sleep 1
s =<<SVG
<svg width="400" height="110">
   <line x1="0" y1="0" x2="200" y2="200" style="stroke:rgb(0,255,0);stroke-width:2" />
</svg>
SVG
app.svg = s
area = app.refresh


In the above example a Gtk2 application is executed and displays a red diagonal line for 1 second, and then changes to a green colour.