basic wxpython help

2008-02-16 Thread Vamp4L
Hello,
  I'm brand new to wxpython, trying to implement some code to add rows
in the GUI dynamically.  What I want to do is when you click on the
Add Row button, a new row gets added after the first row, before the
button.  This code adds a row in the right place, but it overlaps the
button because it doesn't shift the button down.  Here's what I have
so far:

class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)

fgs = self.fgs = wx.FlexGridSizer(cols=1, hgap=10, vgap=10)

fgs.Add(wx.StaticText(self, -1, "Label 1"))
a1a = self.a1a = wx.FlexGridSizer(cols=5, hgap=10, vgap=10)
fgs.Add(a1a)
a1a.Add(wx.StaticText(self, -1, "User:"))
cc = wx.Choice(self, -1, choices=["A", "B"])
a1a.Add(cc)

cc = FileSelectorCombo(self, size=(250, -1))
a1a.Add((10,10))
a1a.Add(wx.StaticText(self, -1, "Path:"))
a1a.Add(cc)

b = wx.Button(self, -1, "Add Row", (50,50))
self.Bind(wx.EVT_BUTTON, self.OnButtonIE7, b)
fgs.Add(b)

box = wx.BoxSizer()
box.Add(fgs, 1, wx.EXPAND|wx.ALL, 20)
self.SetSizer(box)

a1 = wx.FlexGridSizer(cols=5, hgap=10, vgap=10)
fgs.Add(a1)
b = wx.Button(self, -1, "Run Report", (50,50))
self.Bind(wx.EVT_BUTTON, self.OnButtonRun, b)
a1.Add(b)

b = wx.Button(self, -1, "Close", (50,50))
self.Bind(wx.EVT_BUTTON, self.OnButtonClose, b)
a1.Add(b)


def OnButtonIE7(self, evt):
self.a1a.Add(wx.StaticText(self, -1, "Label 1"))
self.a1a.Layout()

def OnButtonRun(self, evt):
wx.StaticText(self, -1, "User:")

def OnButtonClose(self, evt):
dlg = wx.MessageDialog(self, "Are you sure you want to exit?",
"Exit", wx.YES_NO | wx.ICON_QUESTION)
if dlg.ShowModal() == wx.ID_YES:
self.Destroy() # frame
sys.exit(1)
dlg.Destroy()

Any suggestions?
Thanks!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: basic wxpython help

2008-02-16 Thread Vamp4L
Thanks Mike,
  Simple enough!  I was wandering about the close method too, I had to
hack that together from what I knew about python already.  I'll be
sure to join that mailing list.
-- 
http://mail.python.org/mailman/listinfo/python-list


Convert binary file

2008-03-17 Thread Vamp4L
Hello,
  Specifically, I'm trying to convert the Internet Explorer history
file (index.dat) into a readable format.  Anyone done something
similar or know of any functions that may help with such a task?  I'm
not sure exactly what kind of file the index.dat is, it is some kind
of binary file.  I have tried some of the binascii functions (http://
docs.python.org/lib/module-binascii.html) without any luck.
 Thanks
-- 
http://mail.python.org/mailman/listinfo/python-list