{"id":117,"date":"2009-08-17T18:21:57","date_gmt":"2009-08-17T22:21:57","guid":{"rendered":"http:\/\/www.sofastatistics.com\/blog\/?p=117"},"modified":"2010-03-19T21:29:11","modified_gmt":"2010-03-20T01:29:11","slug":"wxpython-hourglass-cursor-not-working-in-ubuntu","status":"publish","type":"post","link":"https:\/\/www.sofastatistics.com\/blog\/wxpython-hourglass-cursor-not-working-in-ubuntu\/","title":{"rendered":"wxPython hourglass cursor not working in Ubuntu"},"content":{"rendered":"<p>The following code worked in Windows but not in Ubuntu:<\/p>\n<p><code># hourglass cursor<\/code><\/p>\n<div>curs\u00a0=\u00a0wx.StockCursor(wx.CURSOR_WAIT)<\/div>\n<div>self.SetCursor(curs)<\/div>\n<div>Something happens that takes a while &#8230; &#8230; &#8230; &#8230;<\/div>\n<div>#\u00a0Return\u00a0to\u00a0normal\u00a0cursor<\/div>\n<div>curs\u00a0=\u00a0wx.StockCursor(wx.CURSOR_ARROW)<\/div>\n<div>self.SetCursor(curs)<\/div>\n<p>Use instead:<\/p>\n<p><code>wx.BeginBusyCursor()<br \/>\nwx.EndBusyCursor()<\/code><\/p>\n<p>NB good to use wx.IsBusy() with EndBusyCursor().\u00a0 On Windows, ending a cursor if one is not running causes an error.<\/p>\n<p><code>if wx.IsBusy():<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;wx.EndBusyCursor()<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The following code worked in Windows but not in Ubuntu: # hourglass cursor curs\u00a0=\u00a0wx.StockCursor(wx.CURSOR_WAIT) self.SetCursor(curs) Something happens that takes a while &#8230; &#8230; &#8230; &#8230; #\u00a0Return\u00a0to\u00a0normal\u00a0cursor curs\u00a0=\u00a0wx.StockCursor(wx.CURSOR_ARROW) self.SetCursor(curs) Use instead: wx.BeginBusyCursor() wx.EndBusyCursor() NB good to use wx.IsBusy() with EndBusyCursor().\u00a0 On Windows, ending a cursor if one is not running causes an error. if wx.IsBusy(): &nbsp;&nbsp;&nbsp;&nbsp;wx.EndBusyCursor()<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5,6],"tags":[],"class_list":["post-117","post","type-post","status-publish","format-standard","hentry","category-developers","category-python","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/www.sofastatistics.com\/blog\/wp-json\/wp\/v2\/posts\/117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sofastatistics.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sofastatistics.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sofastatistics.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sofastatistics.com\/blog\/wp-json\/wp\/v2\/comments?post=117"}],"version-history":[{"count":8,"href":"https:\/\/www.sofastatistics.com\/blog\/wp-json\/wp\/v2\/posts\/117\/revisions"}],"predecessor-version":[{"id":263,"href":"https:\/\/www.sofastatistics.com\/blog\/wp-json\/wp\/v2\/posts\/117\/revisions\/263"}],"wp:attachment":[{"href":"https:\/\/www.sofastatistics.com\/blog\/wp-json\/wp\/v2\/media?parent=117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sofastatistics.com\/blog\/wp-json\/wp\/v2\/categories?post=117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sofastatistics.com\/blog\/wp-json\/wp\/v2\/tags?post=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}