c - 用于滚动 H 的 GTK 应用程序
问题描述
我是一名 Linux 内核开发人员,我们有一块运行 Yocto Image 的开发板,需要显示“全黑屏,滚动 H ”以进行 CISPR 测试。我正在为此使用 GTK 库,编写了一个示例代码,它使整个屏幕空白并在中心写上“Hello World”。
#include <gtk/gtk.h>
int main (int argc, char *argv[])
{
GtkWidget *window;// GtkWidget is the storage type for widgets
GtkWidget *label;
gtk_init (&argc, &argv);// This is called in all GTK applications. Arguments are parsed
//from the command line and are returned to the application.
window=gtk_window_new(GTK_WINDOW_TOPLEVEL); //creating a new window.
label = gtk_label_new("Hello World");
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
gtk_container_add(GTK_CONTAINER(window), label);
gtk_window_set_decorated(GTK_WINDOW(window), FALSE);
GdkCursor* Cursor = gdk_cursor_new(GDK_BLANK_CURSOR);
GdkWindow* win = gtk_widget_get_window((window));
gdk_window_set_cursor((win),Cursor);
gtk_widget_show_all(window); //The final step is to display this newly created widget.
gtk_main (); //All GTK applications must have a gtk_main(). Control ends here
//and waits for an event to occur (like a key press or mouse event).
return 0;
}
由于我是 GUI 的新手,任何人都可以指导我应该使用哪些小部件来获得滚动 H。
解决方案
推荐阅读
- python - 在 panda3d 中切换按钮
- python - How can I classify big text data with scikit-learn?
- javascript - 将 p5.js 合并到 Next.js(React App)网站中
- r - scipen和digits有什么用
- arrays - 使用索引的迭代变量在for循环中回显批处理文件数组元素?
- java - 无法使用 Selenium WebDriver 单击 tSPAN 按钮
- reporting-services - SSRS 隐藏重复和隐藏空白
- javascript - 使用 AMP HTML,是否可以从单击的元素中获取 ID 或其他属性、附加它们并为锚标记创建 URL?
- python - 将两列与值分组以获得第三列
- react-admin - 已删除项目的已删除列表或自定义列表