From: Phil E. <ph...@li...> - 2005-07-29 08:42:37
|
On Wed, 2005-07-27 at 13:58 -0700, bri...@sy... wrote: > In the past I've hacked the styles for wx.Frame init in the file model.py > but that is kind of ugly > If you want to try, it has worked for many of the windows styles listed in > the wxWidgets help > for class wxFrame. > > I haven't done it for recent wxWidgets/PythonCard versions. > > pyt...@li... wrote on 07/27/2005 01:29:18 > PM: > > > Hi there. > > > > I was just wondering if there is any possibility to make a window > > with toolbox-look (you know: a a narrow titlebar with only a > close-button)...? > > If, so how...? > > I have just such a window in an appplication of mine. Put this code in your PythonCard application: -----begin code----- class MyMiniFrame(wx.MiniFrame): def __init__( self, parent, title, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE ): wx.MiniFrame.__init__(self, parent, -1, title, pos, size, style) panel = wx.Panel(self, -1) txt = wx.StaticText(self, -1, "Scanning, please wait...") txt.SetPosition((20,10)) self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) def OnCloseWindow(self, event): self.Destroy() ------end code------ Then to make the window appear, the code I have is this: -----begin code----- def on_scanBtn_mouseClick(self, event): win = MyMiniFrame(self, "Wireless Network Scan", style=wx.DEFAULT_FRAME_STYLE | wx.TINY_CAPTION_HORIZ) win.SetSize((200, 60)) win.CenterOnParent(wx.BOTH) win.Show(True) win.Update() win.Refresh() wx.Yield() cmd = '/sbin/iwlist %s scan' % self.iface result = commands.getoutput(cmd) win.Close() ------end code------ Hope this helps. |