Saturday, 17 July 2021

Change the cursor

The script shows how to change the cursor of a program. The shape of the cursor outside the main window of the program remains unchanged.



  1. Define a combo box of text.
  2. Store a list of cursor names in the combo box.
  3. Change the cursor to pointer (the shape of a pointing finger) when the main window is shown.
  4. When a cursor name is selected from the combo box, change the cursor of the program according to the name.
  5. When the program is quit, the shape of the cursor will reset to default.

Source Code


Reference:

  • https://developer.gnome.org/gdk3/stable/gdk3-Cursors.html
  • https://blog.gtk.org/2016/05/18/cursors-in-gtk/

No comments:

Post a Comment