aboutsummaryrefslogtreecommitdiffstats
path: root/wxbe
diff options
context:
space:
mode:
authorAaron Bentley <aaron.bentley@utoronto.ca>2005-03-10 06:05:42 +0000
committerAaron Bentley <aaron.bentley@utoronto.ca>2005-03-10 06:05:42 +0000
commitc005f7b630d3c97c8b52e6d11f3fa843fbdcd15f (patch)
tree4e661dc98d36dacd1342f6f1ccdeec92ea3d8e1c /wxbe
parent1c8efb3cfbcb9a71a47376e8e2a4d379822c0c9c (diff)
downloadbugseverywhere-c005f7b630d3c97c8b52e6d11f3fa843fbdcd15f.tar.gz
Added wxPython GUI
Diffstat (limited to 'wxbe')
-rwxr-xr-xwxbe43
1 files changed, 43 insertions, 0 deletions
diff --git a/wxbe b/wxbe
new file mode 100755
index 0000000..a83a896
--- /dev/null
+++ b/wxbe
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+from wxPython.wx import *
+from wxPython.lib.mixins.listctrl import wxListCtrlAutoWidthMixin
+from libbe import bugdir
+
+class MyApp(wxApp):
+ def OnInit(self):
+ frame = wxFrame(NULL, -1, "Bug display")
+ frame.Show(true)
+ self.SetTopWindow(frame)
+ sizer = wxBoxSizer(wxVERTICAL)
+ bugs = BugList(frame)
+ bugs.SetSize((400, 65))
+# bugs.SetDimensions(-1, -1, -1, -1)
+ sizer.Add(bugs, wxGROW)
+ frame.SetSizer(sizer)
+ frame.Layout()
+ return true
+
+class BugList(wxListCtrl, wxListCtrlAutoWidthMixin):
+ def __init__(self, parent):
+ wxListCtrl.__init__(self, parent, -1,
+ style = wxLC_REPORT|wxLC_VRULES|wxLC_HRULES)
+ wxListCtrlAutoWidthMixin.__init__(self)
+ columns = ("Severity", "Creator", "Summary")
+ for x in range(len(columns)):
+ self.InsertColumn(x, columns[x])
+ self.SetColumnWidth(x, wxLIST_AUTOSIZE_USEHEADER)
+ for bug in [b for b in bugdir.tree_root(".").list() if b.active]:
+ id = self.InsertStringItem(self.GetItemCount(), bug.severity)
+ self.SetStringItem(id, 1, bug.creator)
+ self.SetStringItem(id, 2, bug.summary)
+ self.EnsureVisible(id)
+ for x in range(len(columns)):
+ self.SetColumnWidth(x, wxLIST_AUTOSIZE)
+ conts_width = self.GetColumnWidth(x)
+ self.SetColumnWidth(x, wxLIST_AUTOSIZE_USEHEADER)
+ if conts_width > self.GetColumnWidth(x):
+ self.SetColumnWidth(x, conts_width)
+
+
+app = MyApp(0)
+app.MainLoop()