The control is called a wxStaticBox, sample of use below. BTW, not sure if I wrote this code or not, doesn't look like my style, but could just be that I wrote it a long time ago.
Anyway, pay special attention to the wxStaticBoxSizer, which is what has to be used to properly size the internal controls.
HTH,
Mike
from wxPython.wx import *
DT_HEADERS = ['Code','Name','Value']
class MainPanel(wxPanel):
def __init__(self,parent):
wxPanel.__init__(self,parent,-1)
#box = wxBoxSizer(wxVERTICAL)
group =wxStaticBox(self,-1,"Details")
box = wxStaticBoxSizer(group,wxVERTICAL)
self.list = wxListCtrl(group,100,size=(300,200),
style=wxLC_REPORT|wxLC_SINGLE_SEL|wxSUNKEN_BORDER)
for i in range(len(DT_HEADERS)):
self.list.InsertColumn(i,DT_HEADERS[i])
box.Add(self.list,1,wxEXPAND|wxALL,4)
self.SetAutoLayout(true)
self.SetSizer(box)
box.Fit(self)
box.SetSizeHints(self)
#def OnPaint(self,event):
# dc = wxPaintDC(self)
# self.Refresh()
# event.Skip()
class MainFrame(wxFrame):
def __init__(self, parent,title):
wxFrame.__init__(self, parent,-1,title)
self.CreateStatusBar()
box = wxBoxSizer(wxVERTICAL)
self.mp = MainPanel(self)
box.Add(self.mp,1,wxEXPAND)
self.SetAutoLayout(true)
self.SetSizer(box)
box.Fit(self)
box.SetSizeHints(self)
self.Center(wxBOTH)
def OnCloseWindow(self,event):
self.Destroy()
class MainApp(wxApp):
def OnInit(self):
frame = MainFrame(NULL,"Wx-Template")
frame.Show(true)
self.SetTopWindow(frame)
return true
def main():
app = MainApp(0)
app.MainLoop()
if __name__ == '__main__':
main()
Robb Shecter wrote:
···
Hi,
Anybody know how to make a simple panel or border with the sunken line and a label, like the radio box examples in the demo?
I can't find anything that looks like it'd do this except the radio box itself. (I wonder if I could use a radio box as a generic container...)
Robb
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users
--
_______________________________________
Mike C. Fletcher
Why, yes, I am looking for a job...
http://members.rogers.com/mcfletch/