I don't get those errors at all. Are you on Gtk.jl master?
To get what you expect for the case where you execute it from the command
line, you need to add
if !isinteractive()
wait(Condition())
end
at the end of example_gtk_function.jl. By making it conditional on
isinteractive(), it won't break the other two cases.
--Tim
On Sunday, January 26, 2014 03:44:32 AM Andreas Lobinger wrote:
> Hello,
>
> over there in julia-dev some enthusiasts show Gtk.jl in good shape and
> useful.
> Well, i'm still running into problems, i try to do the same thing, in 3
> versions
>
> 1) execute file
>
> lobi@maroon:~$ more .julia/Cairo/samples/example_gtk_function.jl
>
> using Gtk
>
> using Cairo
>
> c = Canvas(256,256);
>
> w = Window(c,"gtk/cairo example");
>
> draw(c) do widget
> cr = getgc(c)
> set_source_rgb(cr,0,0,1)
> paint(cr)
> end
> lobi@maroon:~$ julia/julia .julia/Cairo/samples/example_gtk_function.jl
> ERROR: access to undefined reference
> in getgc at /home/lobi/.julia/Gtk/src/cairo.jl:91
> in anonymous at /home/lobi/.julia/Cairo/samples/example_gtk_function.jl:11
> in draw at /home/lobi/.julia/Gtk/src/cairo.jl:60
> in draw at /home/lobi/.julia/Gtk/src/cairo.jl:54
> in include_from_node1 at loading.jl:120
> while loading /home/lobi/.julia/Cairo/samples/example_gtk_function.jl, in
> expression starting on line 10
>
> 2) include file on interactive julia
>
> lobi@maroon:~$ julia/julia
> _
> _ _ _(_)_ | A fresh approach to technical computing
> (_) | (_) (_) | Documentation: http://docs.julialang.org
> _ _ _| |_ __ _ | Type "help()" to list help topics
>
> | | | | | | |/ _` | |
> | | |
> | | |_| | | | (_| | | Version 0.3.0-prerelease+1174 (2014-01-23 16:58
>
> UTC)
> _/ |\__'_|_|_|\__'_| | Commit cda141d (2 days old master)
>
> |__/ | i686-linux-gnu
>
> julia> include(".julia/Cairo/samples/example_gtk_function.jl")
> ERROR: access to undefined reference
> in getgc at /home/lobi/.julia/Gtk/src/cairo.jl:91
> in anonymous at /home/lobi/.julia/Cairo/samples/example_gtk_function.jl:11
> in draw at /home/lobi/.julia/Gtk/src/cairo.jl:60
> in draw at /home/lobi/.julia/Gtk/src/cairo.jl:54
> while loading /home/lobi/.julia/Cairo/samples/example_gtk_function.jl, in
> expression starting on line 10
>
> -> opens the window and does the drawing
>
> 3) line-by-line entry
> lobi@maroon:~$ julia/julia
> _
> _ _ _(_)_ | A fresh approach to technical computing
> (_) | (_) (_) | Documentation: http://docs.julialang.org
> _ _ _| |_ __ _ | Type "help()" to list help topics
>
> | | | | | | |/ _` | |
> | | |
> | | |_| | | | (_| | | Version 0.3.0-prerelease+1174 (2014-01-23 16:58
>
> UTC)
> _/ |\__'_|_|_|\__'_| | Commit cda141d (2 days old master)
>
> |__/ | i686-linux-gnu
>
> julia> using Gtk
>
> julia> using Cairo
>
> julia> c = Canvas(256,256);
>
> julia> w = Window(c,"gtk/cairo example");
>
> julia> draw(c) do widget
> cr = getgc(c)
> set_source_rgb(cr,0,0,1)
> paint(cr)
> end
>
> -> opens the window, without warnings/errors
>
> Actually i'm expecting the same behaviour in all three cases.