Skip to content

Instantly share code, notes, and snippets.

@lobingera
lobingera / draw1.svg
Created March 23, 2014 13:08
gtk3 builder example, julia + python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lobingera
lobingera / w_x1.jl
Created May 19, 2015 05:07
trying to wrap xcb.h
using Clang
includes = ["/usr/include",
"/usr/lib/gcc/x86_64-linux-gnu/4.8/include",
"/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed"]
xcbpath = "/usr/include/xcb/"
headers = ["x1.h"]
context=wrap_c.init(output_file="gen_libxcb.jl",
common_file="gen_libxcb_h.jl",
@lobingera
lobingera / drawfilled1.jl
Created June 21, 2015 15:53
really basic painting into an array (as bitmap)
# from
# http://stackoverflow.com/questions/1201200/fast-algorithm-for-drawing-filled-circles#1201304
#
# void DrawFilledCircle(int x0, int y0, int radius)
# {
# int x = radius;
# int y = 0;
# int xChange = 1 - (radius << 1);
# int yChange = 0;
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "help()" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.4.0-dev+5791 (2015-07-04 23:24 UTC)
_/ |\__'_|_|_|\__'_| | Commit 59a1e9c* (1 day old master)
|__/ | x86_64-linux-gnu
julia> include("gtk_anim.jl")
@lobingera
lobingera / gtk_interaction.jl
Last active September 13, 2015 11:38
doing gtk interaction with raw canvas events
using Gtk # master: commit 1e6d7c3b44c2cd7ef621c58bed736c47e8adfe52 Merge: 3ca577c 9971cd5 Author: Tim Holy <tim.holy@gmail.com> Date: Sun Sep 13 04:04:55 2015 -0500
using Cairo # master: commit 9fc2ca1feef0c90195e5da755debca02edc5f111 Merge: 32aad6d ceb861c Author: Tim Holy <tim.holy@gmail.com> Date: Thu Sep 10 05:59:34 2015 -0500
#include("CTM.jl")
module CTM
import Base
@lobingera
lobingera / gtkdraw_signal.jl
Created September 14, 2015 13:00
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));
julia> julia> julia> versioninfo()julia> versioninfo()julia> julia> Pkg.test("Cairo")julia> Pkg.test("Cairo")julia> julia> versioninfo()julia> versioninfo()julia> versioninfo()julia> versioninfo()
[?2004lJulia Version 0.5.0-rc4+0
Commit 9c76c3e* (2016-09-09 01:43 UTC)
DEBUG build
Platform Info:
System: Linux (x86_64-linux-gnu)
CPU: Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
LAPACK: libopenblas64_
AppVeyor
Projects
Environments
Docs
Support
@lobingera
lobingera / anim1.jl
Created June 1, 2017 18:06
gtk / cairo anim simple
using Gtk, Gtk.ShortNames, Graphics
win = Window("Test")
hbox = Box(:h)
setproperty!(hbox, :homogeneous, true)
push!(win, hbox)
for i = 1:4
canv = Canvas()
push!(hbox, canv)
@schedule begin
travis_fold:start:worker_info
Worker information
hostname: wjb-2.macstadium-us-se-1.travisci.net:755c786a-96f2-4175-a354-c7c943a35dc3
version: v2.6.2 https://github.com/travis-ci/worker/tree/fdccca4efd347ebc889baae641ccbf55bb871d19
instance: 9d8a27c2-fcc6-4b2f-90fe-809094386312:travis-ci-osx10.11-xcode7.3-1480691248
startup: 1m37.483916883s
travis_fold:end:worker_info
travis_fold:start:system_info
Build system information