GTK滚动H的应用程序

时间:2019-01-30 11:07:59

标签: c linux user-interface testing gtk

我是Linux Kernel开发人员,我们有一个运行Yocto Image的电路板,要求显示CISPR测试时显示“滚动H的全黑屏幕”。我正在为此使用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。

https://www.youtube.com/watch?v=PWkuqyC3AWk

0 个答案:

没有答案