wisgetwas wondering what widget in gtk (using gtkmm) could be used to implemented the movable button looking thing in the picture. and also the dotted line. dotted line edit: the widget is supposed to be able to move left and right along the time-track to be able to set the play bounds. Here is a video showing how it looks like in after effects. From sescond 37 is how the behaviour for it supposed to be. https://www.youtube.com/watch?v=QxXevteeumg
edit: from what it looks like there isnt a specific widget which could simplify this. However a regular button can be used and then implementing a method for its drage using the various signal handlers associated with a Gtk button
CodePudding user response:
There is no widget that does this (see the widget gallery).
You can, however, add custom widgets using Cairo. In the official Gtkmm book, there is an example for creating a custom clock widget using the Gtk::DrawingArea
. The Gtk::DrawingArea
offers a lot of signals which you can connect to.
I have created my own widgets in the past using this and it worked just fine. However, it was a lot of work because:
- Cairo lacks good documentation. Understanding the philosophy behind this library is a lot of work, often empirical.
- It can be hard to acheive acceptable performance using Cairo. One has to be really careful in how the drawing of the widget is performed. There is often a naive way to do it, which is clearer in the code, but devastating in terms of performance (it often involves useless redraws on the CPU).