0

I'm trying to make a siple list to display sqlite rows in a grid using wxList.

I can't come up with something decent. I can't place correctly the items in the list.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade HG on Wed Sep 22 12:34:17 2010

import wx
import PySqliteGUI	
import sys
# begin wxGlade: extracode
# end wxGlade



class MyPanel(wx.Panel):
    def __init__(self, *args, **kwds):
        # content of this block not found: did you rename this class?
        pass

    def __set_properties(self):
        # content of this block not found: did you rename this class?
        pass

    def __do_layout(self):
        # content of this block not found: did you rename this class?
        pass

# end of class MyPanel


class MyFrame(wx.Frame):
    def __init__(self, *args, **kwds):
        # begin wxGlade: MyFrame.__init__
        kwds["style"] = wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.list_ctrl_1 = wx.ListCtrl(self, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)

        self.__set_properties()
        self.__do_layout()
        # end wxGlade
        tmp=[]
        tmp=PySqliteGUI.database()
        
        
        """
        self.list_ctrl_1.InsertColumn(0, 'Patient ID', width=100)
        self.list_ctrl_1.InsertColumn(0, 'Prova', width=100)
        for i in tmp:
			#i=[]
			#i=(u'cane', 'prova')
			count=3
			for s in i:
				list=wx.ListItem()
				list.SetData(2)
				list.SetWidth(200)
				list.SetText(str(s))
				self.list_ctrl_1.InsertItem(list)
		"""
				

    def __set_properties(self):
        # begin wxGlade: MyFrame.__set_properties
        self.SetTitle("frame_1")
        # end wxGlade

    def __do_layout(self):
        # begin wxGlade: MyFrame.__do_layout
        sizer_1 = wx.BoxSizer(wx.VERTICAL)
        sizer_1.Add(self.list_ctrl_1, 1, wx.EXPAND, 0)
        self.SetSizer(sizer_1)
        sizer_1.Fit(self)
        self.Layout()
        # end wxGlade

# end of class MyFrame


if __name__ == "__main__":
    app = wx.PySimpleApp(0)
    wx.InitAllImageHandlers()
    frame_1 = MyFrame(None, -1, "")
    app.SetTopWindow(frame_1)
    frame_1.Show()
    app.MainLoop()

Ideas?

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by viandante
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.