Bonjour,
Quelles sont les constantes utilisables pour la fonction SetCursor de la lib wxPython ?
Je connais wx.STANDARD, wx.CROSS, wx.PENCIL.
En existe-t-il d'autres ?
Merci.
Version imprimable
Bonjour,
Quelles sont les constantes utilisables pour la fonction SetCursor de la lib wxPython ?
Je connais wx.STANDARD, wx.CROSS, wx.PENCIL.
En existe-t-il d'autres ?
Merci.
http://wxpython.org/onlinedocs.php
tu as ici la liste des Cursor_ID
Citation:
wxCURSOR_ARROW A standard arrow cursor.
wxCURSOR_RIGHT_ARROW A standard arrow cursor pointing to the right.
wxCURSOR_BLANK Transparent cursor.
wxCURSOR_BULLSEYE Bullseye cursor.
wxCURSOR_CHAR Rectangular character cursor.
wxCURSOR_CROSS A cross cursor.
wxCURSOR_HAND A hand cursor.
wxCURSOR_IBEAM An I-beam cursor (vertical line).
wxCURSOR_LEFT_BUTTON Represents a mouse with the left button depressed.
wxCURSOR_MAGNIFIER A magnifier icon.
wxCURSOR_MIDDLE_BUTTON Represents a mouse with the middle button depressed.
wxCURSOR_NO_ENTRY A no-entry sign cursor.
wxCURSOR_PAINT_BRUSH A paintbrush cursor.
wxCURSOR_PENCIL A pencil cursor.
wxCURSOR_POINT_LEFT A cursor that points left.
wxCURSOR_POINT_RIGHT A cursor that points right.
wxCURSOR_QUESTION_ARROW An arrow and question mark.
wxCURSOR_RIGHT_BUTTON Represents a mouse with the right button depressed.
wxCURSOR_SIZENESW A sizing cursor pointing NE-SW.
wxCURSOR_SIZENS A sizing cursor pointing N-S.
wxCURSOR_SIZENWSE A sizing cursor pointing NW-SE.
wxCURSOR_SIZEWE A sizing cursor pointing W-E.
wxCURSOR_SIZING A general sizing cursor.
wxCURSOR_SPRAYCAN A spraycan cursor.
wxCURSOR_WAIT A wait cursor.
wxCURSOR_WATCH A watch cursor.
wxCURSOR_ARROWWAIT A cursor with both an arrow and an hourglass, (windows.)
Je connais cette doc C++.
Le problème vient du fait que sous wxWindows (C++) par exemple la constante wxCURSOR_CROSS devient wx.CROSS_CURSOR sous wxPython.
J'ai donc essayé à partir de wxCURSOR_HAND d'utiliser wx.HAND_CURSOR ou encore wx.HAND, etc. Message retourné par wxPython :
Traceback (most recent call last):
File "/home/...", line 206, in onMouseLeftDown
self.SetCursor(wx.HAND_CURSOR)
AttributeError: 'module' object has no attribute 'HAND_CURSOR'
Merci pour ta réponse aussi rapide.
normal, c'est wx.CURSOR_HAND qu'il faut utiliser
L'instruction self.SetCursor(wx.CURSOR_HAND) retourne la même erreur mais...
l'intruction self.SetCursor(wx.StockCursor(wx.CURSOR_HAND)) est correcte.
Merci pour l'aide.