通过 GTK 或 GDK 直接在屏幕上绘图

发布于 2024-07-24 05:25:49 字数 363 浏览 3 评论 0原文

我正在为一个库开发一个演示应用程序,我和两个同事正在编写该应用程序,以允许 GNOME 应用程序通过 libCanberra 运行音频事件,从而允许用户选择视觉事件来替换它们。 这是一项注重无障碍的努力,旨在帮助视力和听力受损的用户获得音频警报等的好处。

对于我们的第一个演示,我们只是尝试在简单的 GTK 示例应用程序中按下按钮时使整个屏幕闪烁某种颜色。 我一直在查看 GTK 文档,我看到的所有绘图都与直接绘制到窗口或其他小部件有关。 我想控制整个屏幕的色调。 这是 GDK 的事情吗? 我完全偏离基地了吗?

任何链接/帮助将不胜感激! 谢谢。

PS:这是用 C 编写的,尽管我认为具有正确绑定的语言之间的函数应该是相同的。

I am working on a demo application for a library me and two colleagues are writing to allow GNOME applications that run audio events though libCanberra to allow users to select visual events to replace them. This is an accessibility-minded effort to help both visually and aurally impaired users gain the benefits of audio alerts and such.

For our first demo we're simply trying to make the entire screen flash with a color when a button is pressed in our simple GTK sample app. I've been looking at the GTK documentation and all drawing that I've seen has had to do with drawing directly to a window or other widget. I want to control the entire screen's hue. Would this be a GDK thing? Am I completely off base?

Any links/help will be much appreciated! Thanks.

PS: This is being written in C, though functions should be the same between languages with proper bindings, I assume.

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

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

发布评论

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

评论(2

故事与诗 2024-07-31 05:25:49

你不能。 您的应用程序只能访问其自己的窗口,并且不(也不应该)了解有关其他窗口或屏幕的任何信息。 “屏幕”由 GTK 使用的任何后端(X?Win32?DirectFB?)管理。

也就是说,您可以尝试创建一个覆盖整个屏幕区域的“全屏”窗口。 这就是大多数窗口系统中实现全屏应用程序的方式。

You cannot. Your application has access only to its own window, and does not (and should not) know anything about other windows, or the screen. The "screen" is managed by whatever back-end GTK uses (X? Win32? DirectFB?).

That said, you could try to create a "full-screen" window that covers the entire screen area. That is the way full-screen apps are implemented in most windowing systems.

一梦浮鱼 2024-07-31 05:25:49

GTK 没有这样的选项 AFAIK,您可能想使用后端:Xlib(或 Xcb)。

GTK doesn't have such option AFAIK, you probably want to use the backend: Xlib (or Xcb) for that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文