import gi gi.require_version('Gtk', '3.0') gi.require_version('Gdk', '3.0') from gi.repository import Gtk, Gdk def on_mouse_over_button(widget, event): cursor = Gdk.Cursor.new_from_name(widget.get_window(), "pointer") widget.get_window().set_cursor(cursor) button = Gtk.Button(label="Click me!") button.connect("motion-notify-event", on_mouse_over_button) window = Gtk.Window() window.add(button) window.show_all() Gtk.main()In this example, we create a new cursor object with the `new_from_name` method and pass in the `Gdk.Window` object associated with the button to ensure the cursor is set on the correct window. When the `motion-notify-event` is triggered (when the mouse is moved over the button), the `on_mouse_over_button` function is called which sets the cursor for the button window to the cursor we created. This example makes use of the GTK+ 3.0 and Gdk 3.0 libraries.