Mageia Bugzilla – Attachment 6963 Details for
Bug 16650
Crash when opening a file with wxPython compiled with gtk+3
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Test case
test.py (text/x-python), 1.17 KB, created by
Nicolas Salguero
on 2015-08-26 10:30:21 CEST
(
hide
)
Description:
Test case
Filename:
MIME Type:
Creator:
Nicolas Salguero
Created:
2015-08-26 10:30:21 CEST
Size:
1.17 KB
patch
obsolete
>#!/usr/bin/env python ># -*- mode:python ; tab-width:4 -*- ex:set tabstop=4 shiftwidth=4 expandtab: -*- > >import wx >import sys > >class TestFrame(wx.Frame): > def __init__(self): > wx.Frame.__init__(self, None, > style=wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | > wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX | > wx.CLIP_CHILDREN | wx.RESIZE_BORDER) > self.Centre() > self.Show(True) > wx.Button(self, id=wx.ID_OPEN, label='Open') > self.Bind(wx.EVT_BUTTON, self._on_open, id=wx.ID_OPEN) > > def _on_open(self, event): > file_selector = wx.FileDialog(self, 'Open the file', '.', > 'All files (*)|*', > style=wx.OPEN | wx.CHANGE_DIR) > result = file_selector.ShowModal() > path = file_selector.GetPath() > a_file = file_selector.GetFilename() > file_selector.Destroy() > >class TestApp(wx.App): > def OnInit(self): > frame = TestFrame() > self.SetTopWindow(frame) > return True > >def main(): > app = TestApp() > app.MainLoop() > >if __name__ == '__main__': > sys.exit(main())
#!/usr/bin/env python # -*- mode:python ; tab-width:4 -*- ex:set tabstop=4 shiftwidth=4 expandtab: -*- import wx import sys class TestFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, style=wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX | wx.CLIP_CHILDREN | wx.RESIZE_BORDER) self.Centre() self.Show(True) wx.Button(self, id=wx.ID_OPEN, label='Open') self.Bind(wx.EVT_BUTTON, self._on_open, id=wx.ID_OPEN) def _on_open(self, event): file_selector = wx.FileDialog(self, 'Open the file', '.', 'All files (*)|*', style=wx.OPEN | wx.CHANGE_DIR) result = file_selector.ShowModal() path = file_selector.GetPath() a_file = file_selector.GetFilename() file_selector.Destroy() class TestApp(wx.App): def OnInit(self): frame = TestFrame() self.SetTopWindow(frame) return True def main(): app = TestApp() app.MainLoop() if __name__ == '__main__': sys.exit(main())
View Attachment As Raw
Actions:
View
Attachments on
bug 16650
: 6963 |
6964