Thread: Gtk, hide mouse cursor [Vala]
so, i've been trying figure out how hide mouse cursor in gtk program (in vala), or how make invisible.
anyway, found vague references objects needed, code:
however, code doesn't work me, after switching out col_black real color object (empty), , specifying gdk.cursor instead of cursor. compiles , all, doesn't work. can show me working example of code adapted this?code:var pix_data = "#define invisible_cursor_width 1\n#define invisible_cursor_height 1\n#define invisible_cursor_x_hot 0\n#define invisible_cursor_y_hot 0\nstatic unsigned short invisible_cursor_bits[] = {\n0x0000 };"; // this.window refers gdk.window, available after show_all called var pix = gdk.pixmap.create_from_data(this.window, pix_data, 1, 1, 1, col_black, col_black); this.window.set_cursor(new cursor.from_pixmap(pix, pix, col_black, col_black, 0, 0));
here runtime errors get:
(myprogram:32103): gdk-critical **: _gdk_drawable_get_source_drawable: assertion `gdk_is_drawable (drawable)' failed
(myprogram:32103): gdk-critical **: gdk_window_set_cursor: assertion `gdk_is_window (window)' failed
keyword 'this' in program code refers gtk.window object.
if looking answer, worked me:
element_covering_entire_application in application hbox covering entire application.code:gdk.color col_black; gdk.color.parse("fff", out col_black); var pix = new gdk.pixmap(null, 1, 1, 1); element_covering_entire_application.window.cursor = new gdk.cursor.from_pixmap(pix, pix, col_black, col_black, 0, 0);
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Gtk, hide mouse cursor [Vala]
Ubuntu
Comments
Post a Comment