Ganv is an interactive Gtk widget for interactive “boxes and lines” or graph-like environments (e.g. modular synths or finite state machine diagrams).

It is used by Ingen, Patchage, and Machina (see these pages for screenshots).


The latest version of Ganv is 1.4.2, released on August 08, 2014.

Please support Ganv development:


Please file any bugs you find here

19 thoughts on “Ganv

  1. Pingback: Ganv 1.4.2 |

  2. Hi, glad to find ur project. I want to know how to build the ganv, and the Ingen, Patchage, Machina on Window, using Visiual Studio 2013 / 2012.
    I just tried to build ganv using VS2012, and I met the problem such as #include”ganv_config.h”, #include”ganv-marshal.h”…but actually there is no such files in the dir.
    By the way, I want to know what version of GTK+ is surpport ? v 2.x.x ?
    Thank you very much!

    • You will need to seriously know what you’re doing to achieve this. I have not personally compiled Ganv or its dependencies with VS, so it’s almost certainly going to require modifications.

      Those files are built by the waf build process (Python code in wscript). When I build things for Windows I use the same waf-based process as on other platforms. This is definitely the easiest way to do it, the VS GUI isn’t providing any benefit in this case other than the massive PITA to build a project anyway.

  3. how can ? compile this library with GTK3.12.x?there are so many erros I cannot count.Or,manybe there is another project you can recommend which also can draw flow cart with gtk?

  4. Also,while looking for workaround the port controls issue, I discovered the embed() method of the Module class which could also work for me.
    Basically, I want a way to set certain properties of the module. So if I can’t create ports (with controls) to represent those values I could embed widgets in the module.
    I tried it and the embedded Gtk widget displayed but I got a warning on the console: “warning: Non-port item added to module.”
    Is that OK? One would only use embed() to add non-port items otherwise you’d just create a port directly so the warning surprised me.

    Thanks for your time.

  5. Seems as if my previous comment was not submitted. I’m having problems getting controls to display in ports.
    I have successfully created modules with ports but I cannot create a controllable port.
    The sequence of code below doesn’t work:
    The control isn’t shown and port->get_control_value actually returns zero after the set.
    Maybe I’m completely misunderstanding the methods. Thanks.

      • Thanks for replying!

        I called show_control() in the example above but I called it last.
        That’s where I went wrong. In port.c show_control() creates the control so it has to be called before setting any values.

        Anyway I’ve decided to use the second technique, module->embed(gtk_widget), so that I can have checkboxes, spinboxes , textboxes for strings etc.
        The data I need to enter really pertains to the module but I was trying to use un-connectable input ports as a workaround before I found embed().
        The library is warning about non-port widgets but I think it’s just because the same function is called internally to add ports.

        Great software by the way. There aren’t many libraries like it.

        • Right, without show_control there will be nothing around to store the range and values at all (so every single port doesn’t have to pay this overhead on big graphs). I suppose setting the controllable property should do this. Honestly it’s all a bit sloppy and just evolves to suit my needs.

          The warning is due to the module group not understanding the type of the child, and so not keeping a reference to it. This would be a problem in any circumstance other than embed, since that keeps its own pointer. Another dusty little corner really, but not a problem unless you try to put weird things in a module manually. For now I just removed the warning, and also fixed a bug on destruction with embedded widgets.

          Thanks. The canvas bit is a bit hodge-podge, but it gets the job done.

          • It’s given me a really quick path to getting what I need so the dusty corners aren’t bothering me too much! It’s a bonus that the interface looks quite attractive with little effort.

            Background: I have a domain-specific data flow (like puredata or Blender 3D’s cycles Node editor). Each node is a C++ class but creating and connecting everything in code is unpleasant and error prone. So Ganv is part of a tool that creates the network and spits out a file that the C++ program can read to instantiate the classes and establish the node connections. This is why I use embed(). If I have a 4×4 matrix node, for example, which provides a Matrix on its output, I’ll need to embed a Gtk::Grid of Gtk::SpinButtons so that the intial creation parameters can be entered.

            It’s working well but I just noticed an issue. If the Canvas contains a module which has an embedded Gtk widget tree, resizing the application’s main frame will cause all Ganv modules to stop responding to input. You won’t be able to select them, drag them, or manipulate them in any way. It could be my fault because I’m using gtkmm for the first time too. I’m looking into it.

          • OK, re the issue mentioned in the 10:34 post:

            It seems to be an issue with refreshing the interface. The module moves when dragged. It’s just that the display stops automatically refreshing if the main frame is resized and there’s a module with an embedded Gtk::Widget. If I can get it to refresh, for example by resizing again, the module will show up in the new location I’d dragged it to. So I think that inserting an appropriate invalidate/redraw (or whatever the Gtk function call is) will solve it.

          • I created a small test program to check the resizing issue.
            It seems that it only triggers if I embed a Gtk container widget in a Ganv::Module.
            When I embed a Gtk::Spinbutton alone I can resize the main window and the application still refreshes normally.
            But if I embed a Gtk::HBox containing a Gtk::Label and a Gtk::SpinButton, the window will stop refreshing properly when I resize it
            (ie, after the first resize, it will only refresh when I resize ot again so I can’t see items being dragged).

            I’m looking at ganv_module_draw in module.c and the lines
            // Draw embed item
            if (module->impl->embed_item) {
            module->impl->embed_item, cr, cx, cy, cw, ch);
            But I’m not sure why I get the issue only if the window is resized.

          • I sense that I might be going beyond intended use so I’ve redesigned the program so that a separate (non-embedded) panel is created for the parameters of the currently selected module.
            Sorry for blowing up your comments BTW. I have most of the posts here. lol

          • OK. I added the issue below (segfault) to the issue tracker. I believe the change I made fixed it,

  6. Issue Fix?
    I created a std::vector of std::unique_ptr and erase()’d any element I was finished with.
    After doing this the program always crashed eventually with a SIGSEGV in GanvCanvasImpl::on_animate_timeout().
    After perusing the destructors I think I tracked down the issue. The animation timeout function has to be removed (it’s not removed by g_idle_remove_by_data()).
    while (g_idle_remove_by_data(this)) ;
    g_source_remove(_animate_idle_id); //added
    That seemed to have done the trick.

Leave a Reply

Your email address will not be published. Required fields are marked *