Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Nov. 18, 2005 17:18:45

Flavio A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

hiding X cursor


Hello all,
I'm developing an embedded application using GTK for run in an
industrial x86 PC104 computer with Linux (kernel 2.6.11.12), XFree86
version 4.5.99.8, GTK+ version is 2.6.4.
In my develop machine (I'm using Debian Sarge with default GTK+ runtime
& devel libs) I coded to hide the X cursor using the following code :

int
hide_cursor(gpointer user_data)
{

#ifdef HIDE_CURSOR
static unsigned char cursor1_bits = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static unsigned char cursor1mask_bits = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
GdkCursor *cursor;
GdkPixmap *source, *mask;
GdkColor fg = { 0, 0, 0, 0 }; /* Transparent */
GdkColor bg = { 0, 0, 0, 0 }; /* Transparent */

gtk_widget_realize(GTK_WIDGET(user_data));
source = gdk_bitmap_create_from_data(NULL, cursor1_bits,
cursor1_width, cursor1_height);
mask = gdk_bitmap_create_from_data(NULL, cursor1mask_bits,
cursor1_width, cursor1_height);
cursor = gdk_cursor_new_from_pixmap(source, mask, &fg, &bg, 8, 8);
gdk_pixmap_unref(source);
gdk_pixmap_unref(mask);
gdk_window_set_cursor(GTK_WIDGET(user_data)->window, cursor);
#endif

return 0;
}

this code is from GDK Reference Manual, running in my develop machine
runs OK, the cursor disappears, but when I runs in my target board I see
the X cursor in screen, it not disappears, I run my program in target
board using :

xinit /usr/local/bin/maqface

but if I run using the same way in my develop machine the cursor
normally disappears.

What can be the problem ?

Thanks for any help


--
Flavio Alberto Lopes Soares <>

_______________________________________________
gtk-list mailing list
gtk-list@gnome.orghttp://mail.gnome.org/mailman/listinfo/gtk-list

Offline

Board footer

Moderator control

Enjoy the 18th of November
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support