Created
February 9, 2012 12:42
-
-
Save mkorpela/1779779 to your computer and use it in GitHub Desktop.
This seems to jam while Chrome is running
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import wx | |
print wx.__version__ | |
print sys.version_info | |
class MyFrame(wx.Frame): | |
def __init__(self, parent, id, title): | |
wx.Frame.__init__(self, parent, id, title) | |
class MyMenuApp( wx.App): | |
def OnInit(self): | |
frame = MyFrame(None, -1, 'No more chrome open') | |
sz = wx.BoxSizer() | |
p = wx.PopupWindow(frame) | |
p.SetSize((100, 100)) | |
panel = wx.Panel(p) | |
print 'now creating the jam button' | |
b = wx.Button(panel, label='jam', size=(100, 25)) # <-- THIS HERE IS WHERE WE END UP | |
# THIS ALL HAPPENS AFTER THE BADNESS OF THE CHROME | |
print 'jam button created' | |
szr = wx.BoxSizer(wx.VERTICAL) | |
szr.Add(b) | |
panel.SetSizer(szr) | |
panel.Fit() | |
sz.Add(p, 0, wx.GROW|wx.ALL, 5) | |
frame.Show(True) | |
self.SetTopWindow(frame) | |
wx.CallLater(1000, frame.Close) | |
return True | |
print """ | |
Welcome to my little program that will jam until Chrome is closed. | |
Setup: | |
* Windows 7 - 64 bit | |
* wxpython 2.8 ( 2.8.12.1 ) | |
* python 2.7.2 | |
So what to do: | |
1) Start this script | |
2) Play with Chrome (open some tabs and pages) | |
3) At some point the script will stop while in "now creating the jam button" | |
4) Close chrome | |
==> And things start to go on again | |
""" | |
for i in range(1000): | |
app = MyMenuApp(0) | |
app.MainLoop() | |
app.Destroy() | |
print i | |
print 'program ended' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment