[gtkmm] Drawing primitves on top of widgets: (how) can it be done?


I'm wondering whether it's possible in gtkmm to draw graphics primitives such 
as lines over the top of widgets, and have them stay there when the widget is 
updated.  I had hoped that this would be possible with a Gnome::Canvas, but 
from playing around with the demo code, it appears that it is not, since the 
widgets are always drawn on top of the graphics.

What I'm trying to do is implement a "modular synth" style gui, where there 
are a number of modules which can be dragged around the window.  Each module 
can contain arbitrary widgets such as sliders, as well as "ports," which 
appear as holes in the modules' surfaces.  Ports can be connected with wires, 
which will be parabolic curves a few pixels thick.  These should be drawn 
over the top of the modules, and should follow the ports around when a module 
is dragged.

The only way I can think of to do this is to render the wires simultaneously 
into a DrawingArea and a bitmap, and use the bitmap as a shape_combine_mask 
on the DrawingArea's window.  This is obviously a lot of work, though, and 
I'm not sure how well it would work, so if anyone knows of an easier or 
better way, please let me know.  I'd be really interested to know how other 
people on this list would approach this problem.

Thanks in advance,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]