Created
September 14, 2015 13:00
-
-
Save lobingera/1a5e103c4ff56f191dce to your computer and use it in GitHub Desktop.
simple draw on gtk canvas example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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