Skip to content
This repository has been archived by the owner on Mar 26, 2023. It is now read-only.

List of Cursors

Bhavye Mathur edited this page Jul 7, 2020 · 5 revisions

The Goopy library currently supports all the cursors supported by Tkinter and does not support custom cursors.

To use these cursors on a graphics object, simply type the name (string given next to the thumbnails) of the cursor into the cursor parameter of the graphic object (detailed more in the GraphicsObject Wiki):

from goopy.objects.Rectangle import Rectangle
from goopy.GraphWin import GraphWin
from goopy.Point import Point

window = GraphWin(title="Cursor Example", width=600, height=600, autoflush=False)

rect = Rectangle(Point(100, 100), Point(500, 500), cursor="select").draw(window)

while True:
    window.update_win()

This code makes the cursor change to the select hand whenever you hover over the rectangle and back to an arrow when you don't. The arrow is the default cursors.

Code Output

Goopy also has some cursors that change automatically, take this for example:

from goopy.objects.Rectangle import Rectangle
from goopy.GraphWin import GraphWin
from goopy.Point import Point

window = GraphWin(title="Cursor Example", width=600, height=600, autoflush=False)

rect = Rectangle(Point(100, 100), Point(500, 500), cursor="select").draw(window)
rect.set_resizable(top=True, bottom=True, left=True, right=True)

while True:
    window.update_win()

This code is exactly the same as the previous, except we tell Goopy that we want to be able to resize the rectangle in all 4 directions. Thus, when you hover over an edge of the rectangle, the cursor changes:

Code Output

Here is a list of Cursors with their thumbnails:


Arrows

  1. arrow thumbnail arrow (default)
  2. small-arrow thumbnail small-arrow
  3. question-arrow thumbnail question-arrow
  4. flipped-pointer thumbnail flipped-pointer
  5. flipped-arrow thumbnail flipped-arrow
  6. thin-flipped-arrow thumbnail thin-flipped-arrow
  7. pointer-arrow thumbnail pointer-arrow
  8. rotating-arrow thumbnail rotating-arrow

Select & Common

  1. select thumbnail select
  2. x thumbnail x
  3. move thumbnail move
  4. crosshair thumbnail crosshair
  5. text-cursor thumbnail text-cursor
  6. loading thumbnail loading

Based Arrows

based-down-arrow thumbnail based-down-arrow based-up-arrow thumbnail based-up-arrow


Corner Cursors

  1. bottom-left-corner thumbnail bottom-left-corner bottom-left-corner-arrow thumbnail bottom-left-corner-arrow

  2. bottom-right-corner thumbnail bottom-right-corner bottom-right-corner-arrow thumbnail bottom-right-corner-arrow

  3. top-left-corner thumbnail top-left-corner top-left-corner-arrow thumbnail top-left-corner-arrow

  4. top-right-corner thumbnail top-right-corner top-right-corner-arrow thumbnail top-right-corner-arrow


T-Cursors

top-t thumbnail top-t bottom-t thumbnail bottom-t left-t thumbnail left-t right-t thumbnail right-t


Directional Arrows

up-arrow thumbnail up-arrow up-arrow-thin thumbnail up-arrow-thin down-arrow thumbnail down-arrow left-arrow thumbnail left-arrow right-arrow thumbnail right-arrow


Resizing Arrows

double-arrow thumbnail double-arrow horizontal-resizing-arrow thumbnail horizontal-resizing-arrow vertical-resizing-arrow thumbnail vertical-resizing-arrow sizing thumbnail sizing


Downloading Cursors

top-download thumbnail top-download download thumbnail download left-download thumbnail left-download right-download thumbnail right-download


Less-Common

plus thumbnail plus diamond-plus thumbnail diamond-plus inverted-plus thumbnail inverted-plus t-cross thumbnail t-cross


Shapes

circle thumbnail circle donut thumbnail donut heart thumbnail heart box thumbnail box target thumbnail target spiral thumbnail spiral diamond-box thumbnail diamond-box blackbox thumbnail blackbox iron-cross thumbnail iron-cross


Buttons

left-button thumbnail left-button right-button thumbnail right-button middle-button thumbnail middle-button mouse thumbnail mouse


Misc & Objects

bird thumbnail bird boat thumbnail boat sailboat thumbnail sailboat clock thumbnail clock maze thumbnail maze maze-symbol thumbnail maze-symbol mug thumbnail mug shuttle thumbnail shuttle pencil thumbnail pencil pirate thumbnail pirate diamond-plus thumbnail diamond-plus spider thumbnail spider star thumbnail star stickman thumbnail stickman spraycan thumbnail spraycan umbrella thumbnail umbrella virus thumbnail virus volcano thumbnail volcano pointer thumbnail pointer