Skip to content

Instantly share code, notes, and snippets.

@lobingera
Created September 14, 2015 13:00
Show Gist options
  • Save lobingera/1a5e103c4ff56f191dce to your computer and use it in GitHub Desktop.
Save lobingera/1a5e103c4ff56f191dce to your computer and use it in GitHub Desktop.
simple draw on gtk canvas example
using Gtk #master -> commit 9fc2ca1feef0c90195e5da755debca02edc5f111 Merge: 32aad6d ceb861c Author: Tim Holy <tim.holy@gmail.com> Date: Thu Sep 10 05:59:34 2015 -0500
type pgraph
c::Gtk.GtkWidget
end
function on_draw_event(w::Ptr{Gtk.GObject},cc::Ptr{Void},p::pgraph)
display(w);
display(cc);
display(pointer_from_objref(p.c));
#print(Gtk.allocation(w))
Int32(false)
end
function window1()
c = Gtk.@GtkCanvas();
w = Gtk.@GtkWindow(c,"title b1");
p = pgraph(c);
signal_connect(on_draw_event,c,:draw,Cint,(Ptr{Void},),true,p);
show(c);
nothing
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment