Hello
I`m new to gtk and this is my first program. Its running on a ARM machine with a Touchscreen (no, not a smatphone/tablet). It`s an embedded computer.
So, the application is running very good and I can click the buttons with my finger. But I don`t see any mouse cursor.
I tried:
Code:
cur = gdk_cursor_new(GDK_ARROW);
gdk_window_set_cursor ( GTK_WINDOW(widget) > window , cur);
gdk_flush();
But it didn`t work.
Here is the complete main code:
Code:
int main (int argc, char *argv[])
{
int retval = 0;
GtkWidget *window;
GtkWidget *widget;
GtkWidget *box;
GtkWidget *label1;
GtkWidget *label2;
GtkWidget *label3;
GtkWidget *label4;
GtkWidget *label5;
GtkWidget *button1;
GtkWidget *button2;
GtkWidget *button3;
GtkWidget *button4;
GtkWidget *button5;
GdkCursor *cur=NULL;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size(GTK_WINDOW(window), 1024, 768);
cur = gdk_cursor_new(GDK_ARROW);
gdk_window_set_cursor ( GTK_WINDOW(widget) > window , cur);
gdk_flush();
box = gtk_fixed_new();
label1 = gtk_label_new("Messpunkt 1");
gtk_widget_modify_font (label1,pango_font_description_from_string ("Monospace 12"));
gtk_fixed_put(GTK_FIXED(box), label1, (MP1_XC-40), (MP1_YC-95));
label2 = gtk_label_new("Messpunkt 2");
gtk_widget_modify_font (label2,pango_font_description_from_string ("Monospace 12"));
gtk_fixed_put(GTK_FIXED(box), label2, (MP2_XC-40), (MP2_YC-95));
label3 = gtk_label_new("Messpunkt 3");
gtk_widget_modify_font (label3,pango_font_description_from_string ("Monospace 12"));
gtk_fixed_put(GTK_FIXED(box), label3, (MP3_XC-40), (MP3_YC-95));
label4 = gtk_label_new("Messpunkt 4");
gtk_widget_modify_font (label4,pango_font_description_from_string ("Monospace 12"));
gtk_fixed_put(GTK_FIXED(box), label4, (MP4_XC-40), (MP4_YC-95));
label5 = gtk_label_new("Messpunkt 5");
gtk_widget_modify_font (label5,pango_font_description_from_string ("Monospace 12"));
gtk_fixed_put(GTK_FIXED(box), label5, (MP5_XC-40), (MP5_YC-95));
gtk_container_add(GTK_CONTAINER(window), box);
button1 = gtk_button_new_with_label("Touch Test Punkt 1");
button2 = gtk_button_new_with_label("Touch Test Punkt 2");
button3 = gtk_button_new_with_label("Touch Test Punkt 3");
button4 = gtk_button_new_with_label("Touch Test Punkt 4");
button5 = gtk_button_new_with_label("Dauerlauf");
gtk_signal_connect (GTK_OBJECT (button5), "clicked", GTK_SIGNAL_FUNC (Dauerlauf_clicked), NULL);
gtk_fixed_put(GTK_FIXED(box), button1, 460, 150);
gtk_fixed_put(GTK_FIXED(box), button2, 724, 364);
gtk_fixed_put(GTK_FIXED(box), button3, 460, 550);
gtk_fixed_put(GTK_FIXED(box), button4, 200, 364);
gtk_fixed_put(GTK_FIXED(box), button5, 20, 724);
gtk_container_add(GTK_CONTAINER(window), box);
gtk_widget_show_all(box);
g_signal_connect(window, "expose-event", G_CALLBACK (on_expose), NULL);
gtk_widget_set_app_paintable(window, TRUE);
gtk_widget_show_all(window);
gtk_main();
return 0;
}
I`m sorry for this stupid question, but at the moment I can`t see the way to success... :-(
Thanks for any help!
Best regards
Mr Bean