I have a project built in Python, PyGTK 2.24, and PyGST (GStreamer). I have my video working perfectly in a gtk.DrawingArea object.
However, I need to display other GUI elements OVER this video while it is playing. (Please don’t ask why, just trust me.) Right now, they all appear to be behind. In the code, the video objects (and gtk.DrawingArea) are declared and put into the gtk.Fixed FIRST, following by everything else.
So, how do I do this? Do I need to change what object GStreamer is playing on? I know it is possible…I’ve seen GStreamer programs that have things like buttons and labels sitting on top of the video.
Thanks in advance!
You can do this in GTK 3.2 and above using
GtkOverlay.If you can’t upgrade, then here is a summary of the old-fashioned way: connect to the
expose-eventsignal of theDrawingArea, and paint the information on yourself using Cairo. When the information changes, trigger a redraw of the drawing area usingwidget.queue_draw(). Make sure your handler runs after the handler that draws the actual video onto the drawing area. This will work for labels and non-interactive GUI elements.If you want an actual functioning GUI element to hover above your video, that’s rather more complicated and I don’t know how to do it. I don’t think
Fixedguarantees any z-order. I suspect that your buttons and whatnot are being overpainted by the video being drawn onto the drawing area, so maybe triggering a redraw of those in yourexpose-eventhandler will work.