什么是在GTK中实现此后效应功能的最接近的小部件

发布于 2025-01-21 17:15:21 字数 547 浏览 4 评论 0 原文

wisget 想知道GTK中的窗口小部件(使用GTKMM)可以用来实现可移动的按钮外观图片中的东西。还有虚线。 虚线 编辑:小部件应该能够沿时间轨道向左和向右移动,以便设置播放界限。这是一个视频,展示了它的外观。从sescond 37中,它应该是它的行为。 https://wwwww.youtube.com/watch?v=qxxxxevteeumg

看起来不是可以简化这一点的特定小部件。但是,可以使用一个常规按钮,然后使用与GTK按钮相关的各种信号处理程序实现其Drage的方法

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七颜 2025-01-28 17:15:21

没有小部件可以执行此操作(请参阅 widget Gallery )。

但是,您可以使用开罗。在官方的GTKMM书中,有一个示例创建一个自定义时钟使用 gtk :: drawdarea 提供了许多您可以连接到的信号。

过去,我已经创建了自己的小部件,它效果很好。但是,这是很多工作,因为:

  1. 开罗缺乏良好的文档。了解该图书馆背后的哲学是很多工作,通常是经验的。
  2. 使用开罗很难获得可接受的表现。必须在如何执行小部件的绘图时非常谨慎。通常有一种天真的方法可以做到这一点,这在代码中更清晰,但在性能方面却是毁灭性的(通常涉及CPU上无用的重新划分)。

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:

  1. Cairo lacks good documentation. Understanding the philosophy behind this library is a lot of work, often empirical.
  2. 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).
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文