diff options
author | David Robillard <d@drobilla.net> | 2011-12-07 02:25:31 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-12-07 02:25:31 +0000 |
commit | ab83f198624534342de6805df68dc85794421f9c (patch) | |
tree | 9975c94262eecc9527f27585e38c50b67aff9d18 /src/module.c | |
parent | a3b80d07bc180dfbf2679930b0137321ff0b477f (diff) | |
download | ganv-ab83f198624534342de6805df68dc85794421f9c.tar.gz ganv-ab83f198624534342de6805df68dc85794421f9c.tar.bz2 ganv-ab83f198624534342de6805df68dc85794421f9c.zip |
Add C test program.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@3824 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/module.c')
-rw-r--r-- | src/module.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/module.c b/src/module.c index 1a76787..acb0a6d 100644 --- a/src/module.c +++ b/src/module.c @@ -57,7 +57,7 @@ ganv_module_init(GanvModule* module) module->widest_input = 0.0; module->widest_output = 0.0; module->show_port_labels = FALSE; - module->must_resize = FALSE; + module->must_resize = TRUE; module->port_size_changed = FALSE; } @@ -550,6 +550,25 @@ ganv_module_class_init(GanvModuleClass* class) node_class->resize = ganv_module_resize; } +GanvModule* +ganv_module_new(GanvCanvas* canvas, + const char* first_prop_name, ...) +{ + GanvModule* module = GANV_MODULE( + g_object_new(ganv_module_get_type(), NULL)); + + GnomeCanvasItem* item = GNOME_CANVAS_ITEM(module); + va_list args; + va_start(args, first_prop_name); + gnome_canvas_item_construct(item, + gnome_canvas_root(GNOME_CANVAS(canvas)), + first_prop_name, args); + va_end(args); + + ganv_canvas_add_node(canvas, GANV_NODE(module)); + return module; +} + void ganv_module_add_port(GanvModule* module, GanvPort* port) |