To be 100% sure that I am not having problems with lcl or with
whatever, I created a pure gtk 1 software and tryed to hide it's
cursor .... but it doesn't work. Any ideas? thanks

program gtk_entry_test;

{$mode objfpc}

uses
glib, gdk, gtk;

function delete_event (widget : pGtkWidget ; event: pGdkEvent; data:
pgpointer ): integer; cdecl;
begin
 writeln('Delete Event Occurred');
 delete_event := ord(true);
 gtk_main_quit();
end;

procedure destroy(widget : pGtkWidget ; data: pgpointer ); cdecl;
begin
 gtk_main_quit();
end;

var
 window, entry :  PGtkWidget;//GtkWidget is the storage type for widgets

 cursorbits: array[0..31] of char;
 cursormask: array[0..31] of char;
 source, mask: PGdkBitmap;
 cursor: PGdkCursor;
 fg, bg: TGdkColor;

begin
 // This is called in all GTK applications. Arguments are parsed
 // from the command line and are returned to the application.
 gtk_init (@argc, @argv);

 // create a new window
 window := gtk_window_new (GTK_WINDOW_TOPLEVEL);

 gtk_signal_connect (pGTKOBJECT (window), 'delete_event',
                     GTK_SIGNAL_FUNC (@delete_event), NIL);

 // Here we connect the "destroy" event to a signal handler
 gtk_signal_connect (pGTKOBJECT (window), 'destroy',
                   GTK_SIGNAL_FUNC (@destroy), NULL);

 // Sets the border width of the window.
 gtk_container_set_border_width (GTK_CONTAINER (window), 10);

 // Creates a new entry
 entry := gtk_entry_new ();

 // This packs the entry into the window (a gtk container).
 gtk_container_add (GTK_CONTAINER (window), entry);

 // Now Hide the cursor

 FillChar(cursorbits, SizeOf(cursorbits), #0);
 FillChar(cursormask, SizeOf(cursormask), #0);

 FillChar(fg, SizeOf(fg), #0);
 FillChar(bg, SizeOf(bg), #0);

 source := gdk_bitmap_create_from_data (nil, cursorbits, 16, 16);
 mask := gdk_bitmap_create_from_data (nil, cursormask, 16, 16);
 cursor := gdk_cursor_new_from_pixmap (source, mask, @fg, @bg, 8, 8);
 gdk_pixmap_unref (source);
 gdk_pixmap_unref (mask);

 gdk_window_set_cursor(window^.window, cursor);

 // The final step is to display this newly created widget.
 gtk_widget_show (entry);

 // and the window
 gtk_widget_show (window);

 // 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).
 gtk_main ();
end.

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to