projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use native TAB traversal for GTK+ 2
[wxWidgets.git]
/
wxPython
/
demo
/
Cursor.py
diff --git
a/wxPython/demo/Cursor.py
b/wxPython/demo/Cursor.py
index 8d05e7cb2cfbcb888408405159437bae33f5e0c8..ddc520b5717ae93691fd96cbdc9c2380d2f728f5 100644
(file)
--- a/
wxPython/demo/Cursor.py
+++ b/
wxPython/demo/Cursor.py
@@
-79,19
+79,18
@@
class TestPanel(wx.Panel):
def OnChooseCursor(self, evt):
# clear the dots
self.win.Refresh()
def OnChooseCursor(self, evt):
# clear the dots
self.win.Refresh()
-
- choice = self.cb.GetStringSelection()
+
+ choice =
evt.GetString() #
self.cb.GetStringSelection()
self.log.write("Selecting the %s cursor\n" % choice)
cnum = cursors[choice]
if cnum == CUSTOMID:
self.log.write("Selecting the %s cursor\n" % choice)
cnum = cursors[choice]
if cnum == CUSTOMID:
- image = images.getBlom12Image()
- image.SetMaskColour(255, 255, 255)
+ image = images.getPointyImage()
# since this image didn't come from a .cur file, tell it where the hotspot is
# since this image didn't come from a .cur file, tell it where the hotspot is
- image.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_X,
0
)
- image.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_Y,
22
)
+ image.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_X,
1
)
+ image.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_Y,
1
)
# make the image into a cursor
cursor = wx.CursorFromImage(image)
# make the image into a cursor
cursor = wx.CursorFromImage(image)
@@
-109,7
+108,8
@@
class TestPanel(wx.Panel):
dc = wx.ClientDC(self.win)
dc.SetPen(wx.Pen("RED"))
dc.SetBrush(wx.Brush("RED"))
dc = wx.ClientDC(self.win)
dc.SetPen(wx.Pen("RED"))
dc.SetBrush(wx.Brush("RED"))
- dc.DrawCircle(evt.GetPosition(), 4)
+ pos = evt.GetPosition()
+ dc.DrawCircle(pos.x, pos.y, 4)
#----------------------------------------------------------------------
#----------------------------------------------------------------------
@@
-135,5
+135,5
@@
This demo shows the stock mouse cursors that are available to wxPython.
if __name__ == '__main__':
import sys,os
import run
if __name__ == '__main__':
import sys,os
import run
- run.main(['', os.path.basename(sys.argv[0])])
+ run.main(['', os.path.basename(sys.argv[0])]
+ sys.argv[1:]
)