]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/ListCtrl.py
Add links to the zip and tar classes.
[wxWidgets.git] / wxPython / demo / ListCtrl.py
CommitLineData
cf694132
RD
1#----------------------------------------------------------------------------
2# Name: ListCtrl.py
3# Purpose: Testing lots of stuff, controls, window types, etc.
4#
5# Author: Robin Dunn & Gary Dumer
6#
7# Created:
8# RCS-ID: $Id$
9# Copyright: (c) 1998 by Total Control Software
10# Licence: wxWindows license
11#----------------------------------------------------------------------------
8fa876ca 12
414f5c2d 13import sys
8fa876ca
RD
14import wx
15import wx.lib.mixins.listctrl as listmix
cf694132 16
8fa876ca 17import images
cf694132
RD
18
19#---------------------------------------------------------------------------
20
dcd38683
RD
21musicdata = {
221 : ("Bad English", "The Price Of Love", "Rock"),
232 : ("DNA featuring Suzanne Vega", "Tom's Diner", "Rock"),
243 : ("George Michael", "Praying For Time", "Rock"),
254 : ("Gloria Estefan", "Here We Are", "Rock"),
265 : ("Linda Ronstadt", "Don't Know Much", "Rock"),
276 : ("Michael Bolton", "How Am I Supposed To Live Without You", "Blues"),
cd096152
RD
287 : ("Paul Young", "Oh Girl", "Rock"),
298 : ("Paula Abdul", "Opposites Attract", "Rock"),
309 : ("Richard Marx", "Should've Known Better", "Rock"),
3110: ("Rod Stewart", "Forever Young", "Rock"),
3211: ("Roxette", "Dangerous", "Rock"),
3312: ("Sheena Easton", "The Lover In Me", "Rock"),
3413: ("Sinead O'Connor", "Nothing Compares 2 U", "Rock"),
3514: ("Stevie B.", "Because I Love You", "Rock"),
3615: ("Taylor Dayne", "Love Will Lead You Back", "Rock"),
3716: ("The Bangles", "Eternal Flame", "Rock"),
3817: ("Wilson Phillips", "Release Me", "Rock"),
3918: ("Billy Joel", "Blonde Over Blue", "Rock"),
4019: ("Billy Joel", "Famous Last Words", "Rock"),
4120: ("Billy Joel", "Lullabye (Goodnight, My Angel)", "Rock"),
4221: ("Billy Joel", "The River Of Dreams", "Rock"),
4322: ("Billy Joel", "Two Thousand Years", "Rock"),
4423: ("Janet Jackson", "Alright", "Rock"),
4524: ("Janet Jackson", "Black Cat", "Rock"),
4625: ("Janet Jackson", "Come Back To Me", "Rock"),
4726: ("Janet Jackson", "Escapade", "Rock"),
4827: ("Janet Jackson", "Love Will Never Do (Without You)", "Rock"),
4928: ("Janet Jackson", "Miss You Much", "Rock"),
5029: ("Janet Jackson", "Rhythm Nation", "Rock"),
5130: ("Janet Jackson", "State Of The World", "Rock"),
5231: ("Janet Jackson", "The Knowledge", "Rock"),
5332: ("Spyro Gyra", "End of Romanticism", "Jazz"),
5433: ("Spyro Gyra", "Heliopolis", "Jazz"),
5534: ("Spyro Gyra", "Jubilee", "Jazz"),
5635: ("Spyro Gyra", "Little Linda", "Jazz"),
5736: ("Spyro Gyra", "Morning Dance", "Jazz"),
5837: ("Spyro Gyra", "Song for Lorraine", "Jazz"),
5938: ("Yes", "Owner Of A Lonely Heart", "Rock"),
6039: ("Yes", "Rhythm Of Love", "Rock"),
b1cfebd9
RD
6140: ("Cusco", "Dream Catcher", "New Age"),
6241: ("Cusco", "Geronimos Laughter", "New Age"),
6342: ("Cusco", "Ghost Dance", "New Age"),
6443: ("Blue Man Group", "Drumbone", "New Age"),
6544: ("Blue Man Group", "Endless Column", "New Age"),
6645: ("Blue Man Group", "Klein Mandelbrot", "New Age"),
6746: ("Kenny G", "Silhouette", "Jazz"),
6847: ("Sade", "Smooth Operator", "Jazz"),
6948: ("David Arkenstone", "Papillon (On The Wings Of The Butterfly)", "New Age"),
7049: ("David Arkenstone", "Stepping Stars", "New Age"),
7150: ("David Arkenstone", "Carnation Lily Lily Rose", "New Age"),
7251: ("David Lanz", "Behind The Waterfall", "New Age"),
7352: ("David Lanz", "Cristofori's Dream", "New Age"),
7453: ("David Lanz", "Heartsounds", "New Age"),
7554: ("David Lanz", "Leaves on the Seine", "New Age"),
dcd38683
RD
76}
77
8fa876ca 78#---------------------------------------------------------------------------
726fc00a 79
d4b73b1b 80class TestListCtrl(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin):
8fa876ca
RD
81 def __init__(self, parent, ID, pos=wx.DefaultPosition,
82 size=wx.DefaultSize, style=0):
83 wx.ListCtrl.__init__(self, parent, ID, pos, size, style)
d4b73b1b 84 listmix.ListCtrlAutoWidthMixin.__init__(self)
726fc00a
RD
85
86
d4b73b1b 87class TestListCtrlPanel(wx.Panel, listmix.ColumnSorterMixin):
cf694132 88 def __init__(self, parent, log):
8fa876ca 89 wx.Panel.__init__(self, parent, -1, style=wx.WANTS_CHARS)
cf694132
RD
90
91 self.log = log
8fa876ca 92 tID = wx.NewId()
5924f6b3
KO
93
94 sizer = wx.BoxSizer(wx.VERTICAL)
95
96 if wx.Platform == "__WXMAC__":
97 self.useNative = wx.CheckBox(self, -1, "Use native listctrl")
98 self.useNative.SetValue(
99 not wx.SystemOptions.GetOptionInt("mac.listctrl.always_use_generic") )
100 self.Bind(wx.EVT_CHECKBOX, self.OnUseNative, self.useNative)
101 sizer.Add(self.useNative, 0, wx.ALL | wx.ALIGN_RIGHT, 4)
102
8fa876ca 103 self.il = wx.ImageList(16, 16)
6d19860f 104
3979290c 105 self.idx1 = self.il.Add(images.getSmilesBitmap())
00887b39
RD
106 self.sm_up = self.il.Add(images.getSmallUpArrowBitmap())
107 self.sm_dn = self.il.Add(images.getSmallDnArrowBitmap())
108
726fc00a 109 self.list = TestListCtrl(self, tID,
8fa876ca 110 style=wx.LC_REPORT
00e4ce13
RD
111 #| wx.BORDER_SUNKEN
112 | wx.BORDER_NONE
8fa876ca 113 | wx.LC_EDIT_LABELS
3b5602d5
RD
114 | wx.LC_SORT_ASCENDING
115 #| wx.LC_NO_HEADER
116 #| wx.LC_VRULES
117 #| wx.LC_HRULES
41d1d7e3 118 #| wx.LC_SINGLE_SEL
1e4a197e 119 )
3b5602d5 120
8fa876ca 121 self.list.SetImageList(self.il, wx.IMAGE_LIST_SMALL)
5924f6b3 122 sizer.Add(self.list, 1, wx.EXPAND | wx.ALL, 4)
cf694132 123
3979290c
RD
124 self.PopulateList()
125
126 # Now that the list exists we can init the other base class,
7869b836 127 # see wx/lib/mixins/listctrl.py
3979290c 128 self.itemDataMap = musicdata
d4b73b1b 129 listmix.ColumnSorterMixin.__init__(self, 3)
1e4a197e 130 #self.SortListItems(0, True)
3979290c 131
5924f6b3
KO
132 self.SetSizer(sizer)
133 self.SetAutoLayout(True)
8fa876ca
RD
134
135 self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, self.list)
136 self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self.OnItemDeselected, self.list)
137 self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated, self.list)
138 self.Bind(wx.EVT_LIST_DELETE_ITEM, self.OnItemDelete, self.list)
139 self.Bind(wx.EVT_LIST_COL_CLICK, self.OnColClick, self.list)
140 self.Bind(wx.EVT_LIST_COL_RIGHT_CLICK, self.OnColRightClick, self.list)
141 self.Bind(wx.EVT_LIST_COL_BEGIN_DRAG, self.OnColBeginDrag, self.list)
142 self.Bind(wx.EVT_LIST_COL_DRAGGING, self.OnColDragging, self.list)
143 self.Bind(wx.EVT_LIST_COL_END_DRAG, self.OnColEndDrag, self.list)
144 self.Bind(wx.EVT_LIST_BEGIN_LABEL_EDIT, self.OnBeginEdit, self.list)
145
146 self.list.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick)
147 self.list.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)
3979290c
RD
148
149 # for wxMSW
8fa876ca 150 self.list.Bind(wx.EVT_COMMAND_RIGHT_CLICK, self.OnRightClick)
3979290c
RD
151
152 # for wxGTK
8fa876ca 153 self.list.Bind(wx.EVT_RIGHT_UP, self.OnRightClick)
3979290c 154
cf694132 155
5924f6b3
KO
156 def OnUseNative(self, event):
157 wx.SystemOptions.SetOptionInt("mac.listctrl.always_use_generic", not event.IsChecked())
158 wx.GetApp().GetTopWindow().LoadDemo("ListCtrl")
159
3979290c 160 def PopulateList(self):
6d19860f 161 if 0:
726fc00a 162 # for normal, simple columns, you can add them like this:
6d19860f 163 self.list.InsertColumn(0, "Artist")
8fa876ca 164 self.list.InsertColumn(1, "Title", wx.LIST_FORMAT_RIGHT)
6d19860f
RD
165 self.list.InsertColumn(2, "Genre")
166 else:
167 # but since we want images on the column header we have to do it the hard way:
8fa876ca
RD
168 info = wx.ListItem()
169 info.m_mask = wx.LIST_MASK_TEXT | wx.LIST_MASK_IMAGE | wx.LIST_MASK_FORMAT
6d19860f
RD
170 info.m_image = -1
171 info.m_format = 0
172 info.m_text = "Artist"
173 self.list.InsertColumnInfo(0, info)
174
8fa876ca 175 info.m_format = wx.LIST_FORMAT_RIGHT
6d19860f
RD
176 info.m_text = "Title"
177 self.list.InsertColumnInfo(1, info)
178
179 info.m_format = 0
180 info.m_text = "Genre"
181 self.list.InsertColumnInfo(2, info)
182
dcd38683 183 items = musicdata.items()
414f5c2d
RD
184 for key, data in items:
185 index = self.list.InsertImageStringItem(sys.maxint, data[0], self.idx1)
186 self.list.SetStringItem(index, 1, data[1])
187 self.list.SetStringItem(index, 2, data[2])
188 self.list.SetItemData(index, key)
cf694132 189
8fa876ca
RD
190 self.list.SetColumnWidth(0, wx.LIST_AUTOSIZE)
191 self.list.SetColumnWidth(1, wx.LIST_AUTOSIZE)
0e947004 192 self.list.SetColumnWidth(2, 100)
cf694132 193
6d19860f 194 # show how to select an item
8fa876ca 195 self.list.SetItemState(5, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
c368d904 196
6d19860f 197 # show how to change the colour of a couple items
c368d904 198 item = self.list.GetItem(1)
8fa876ca 199 item.SetTextColour(wx.BLUE)
c368d904 200 self.list.SetItem(item)
c7e7022c 201 item = self.list.GetItem(4)
8fa876ca 202 item.SetTextColour(wx.RED)
c7e7022c
RD
203 self.list.SetItem(item)
204
bb0054cd 205 self.currentItem = 0
64be6958 206
a08cbc01 207
7869b836 208 # Used by the ColumnSorterMixin, see wx/lib/mixins/listctrl.py
6d19860f
RD
209 def GetListCtrl(self):
210 return self.list
211
7869b836 212 # Used by the ColumnSorterMixin, see wx/lib/mixins/listctrl.py
6d19860f
RD
213 def GetSortImages(self):
214 return (self.sm_dn, self.sm_up)
215
216
a08cbc01 217 def OnRightDown(self, event):
095315e2
RD
218 x = event.GetX()
219 y = event.GetY()
220 self.log.WriteText("x, y = %s\n" % str((x, y)))
221 item, flags = self.list.HitTest((x, y))
8fa876ca 222
70d374ac 223 if item != wx.NOT_FOUND and flags & wx.LIST_HITTEST_ONITEM:
1e4a197e 224 self.list.Select(item)
8fa876ca 225
a08cbc01 226 event.Skip()
bb0054cd 227
185d7c3e
RD
228
229 def getColumnText(self, index, col):
230 item = self.list.GetItem(index, col)
231 return item.GetText()
232
233
bb0054cd 234 def OnItemSelected(self, event):
1e4a197e 235 ##print event.GetItem().GetTextColour()
bb0054cd 236 self.currentItem = event.m_itemIndex
9416aa89
RD
237 self.log.WriteText("OnItemSelected: %s, %s, %s, %s\n" %
238 (self.currentItem,
239 self.list.GetItemText(self.currentItem),
185d7c3e
RD
240 self.getColumnText(self.currentItem, 1),
241 self.getColumnText(self.currentItem, 2)))
8fa876ca 242
9416aa89
RD
243 if self.currentItem == 10:
244 self.log.WriteText("OnItemSelected: Veto'd selection\n")
245 #event.Veto() # doesn't work
246 # this does
8fa876ca
RD
247 self.list.SetItemState(10, 0, wx.LIST_STATE_SELECTED)
248
1fded56b
RD
249 event.Skip()
250
185d7c3e 251
9c2abc2c
RD
252 def OnItemDeselected(self, evt):
253 item = evt.GetItem()
1e4a197e
RD
254 self.log.WriteText("OnItemDeselected: %d" % evt.m_itemIndex)
255
256 # Show how to reselect something we don't want deselected
9c2abc2c 257 if evt.m_itemIndex == 11:
8fa876ca 258 wx.CallAfter(self.list.SetItemState, 11, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
9c2abc2c
RD
259
260
c368d904
RD
261 def OnItemActivated(self, event):
262 self.currentItem = event.m_itemIndex
1e4a197e
RD
263 self.log.WriteText("OnItemActivated: %s\nTopItem: %s" %
264 (self.list.GetItemText(self.currentItem), self.list.GetTopItem()))
c368d904 265
1fded56b
RD
266 def OnBeginEdit(self, event):
267 self.log.WriteText("OnBeginEdit")
268 event.Allow()
269
8bf5d46e
RD
270 def OnItemDelete(self, event):
271 self.log.WriteText("OnItemDelete\n")
272
dcd38683 273 def OnColClick(self, event):
6d19860f 274 self.log.WriteText("OnColClick: %d\n" % event.GetColumn())
b881fc78 275 event.Skip()
6d19860f
RD
276
277 def OnColRightClick(self, event):
3115ef3e
RD
278 item = self.list.GetColumn(event.GetColumn())
279 self.log.WriteText("OnColRightClick: %d %s\n" %
280 (event.GetColumn(), (item.GetText(), item.GetAlign(),
281 item.GetWidth(), item.GetImage())))
dcd38683 282
6d19860f
RD
283 def OnColBeginDrag(self, event):
284 self.log.WriteText("OnColBeginDrag\n")
1192dbd4
RD
285 ## Show how to not allow a column to be resized
286 #if event.GetColumn() == 0:
287 # event.Veto()
288
c7e7022c 289
6d19860f
RD
290 def OnColDragging(self, event):
291 self.log.WriteText("OnColDragging\n")
dcd38683 292
6d19860f
RD
293 def OnColEndDrag(self, event):
294 self.log.WriteText("OnColEndDrag\n")
8bf5d46e 295
bb0054cd
RD
296 def OnDoubleClick(self, event):
297 self.log.WriteText("OnDoubleClick item %s\n" % self.list.GetItemText(self.currentItem))
185d7c3e 298 event.Skip()
a08cbc01 299
bb0054cd
RD
300 def OnRightClick(self, event):
301 self.log.WriteText("OnRightClick %s\n" % self.list.GetItemText(self.currentItem))
cce80896 302
1fded56b 303 # only do this part the first time so the events are only bound once
1e4a197e 304 if not hasattr(self, "popupID1"):
8fa876ca
RD
305 self.popupID1 = wx.NewId()
306 self.popupID2 = wx.NewId()
307 self.popupID3 = wx.NewId()
308 self.popupID4 = wx.NewId()
309 self.popupID5 = wx.NewId()
310 self.popupID6 = wx.NewId()
311
312 self.Bind(wx.EVT_MENU, self.OnPopupOne, id=self.popupID1)
313 self.Bind(wx.EVT_MENU, self.OnPopupTwo, id=self.popupID2)
314 self.Bind(wx.EVT_MENU, self.OnPopupThree, id=self.popupID3)
315 self.Bind(wx.EVT_MENU, self.OnPopupFour, id=self.popupID4)
316 self.Bind(wx.EVT_MENU, self.OnPopupFive, id=self.popupID5)
317 self.Bind(wx.EVT_MENU, self.OnPopupSix, id=self.popupID6)
1e4a197e
RD
318
319 # make a menu
8fa876ca 320 menu = wx.Menu()
1fded56b
RD
321 # add some items
322 menu.Append(self.popupID1, "FindItem tests")
62fc0020 323 menu.Append(self.popupID2, "Iterate Selected")
1e4a197e
RD
324 menu.Append(self.popupID3, "ClearAll and repopulate")
325 menu.Append(self.popupID4, "DeleteAllItems")
326 menu.Append(self.popupID5, "GetItem")
1fded56b 327 menu.Append(self.popupID6, "Edit")
1e4a197e
RD
328
329 # Popup the menu. If an item is selected then its handler
330 # will be called before PopupMenu returns.
095315e2 331 self.PopupMenu(menu)
e166644c 332 menu.Destroy()
1e4a197e 333
a08cbc01
RD
334
335 def OnPopupOne(self, event):
336 self.log.WriteText("Popup one\n")
3b5ccda1
RD
337 print "FindItem:", self.list.FindItem(-1, "Roxette")
338 print "FindItemData:", self.list.FindItemData(-1, 11)
a08cbc01
RD
339
340 def OnPopupTwo(self, event):
62fc0020
RD
341 self.log.WriteText("Selected items:\n")
342 index = self.list.GetFirstSelected()
8fa876ca 343
62fc0020
RD
344 while index != -1:
345 self.log.WriteText(" %s: %s\n" % (self.list.GetItemText(index), self.getColumnText(index, 1)))
346 index = self.list.GetNextSelected(index)
347
a08cbc01
RD
348 def OnPopupThree(self, event):
349 self.log.WriteText("Popup three\n")
3979290c 350 self.list.ClearAll()
8fa876ca 351 wx.CallAfter(self.PopulateList)
cf694132 352
8bf5d46e
RD
353 def OnPopupFour(self, event):
354 self.list.DeleteAllItems()
355
e166644c
RD
356 def OnPopupFive(self, event):
357 item = self.list.GetItem(self.currentItem)
358 print item.m_text, item.m_itemId, self.list.GetItemData(self.currentItem)
359
1fded56b
RD
360 def OnPopupSix(self, event):
361 self.list.EditLabel(self.currentItem)
362
363
cf694132
RD
364#---------------------------------------------------------------------------
365
366def runTest(frame, nb, log):
367 win = TestListCtrlPanel(nb, log)
368 return win
369
370#---------------------------------------------------------------------------
371
372
8fa876ca
RD
373overview = """\
374<html>
375<body>
376A list control presents lists in a number of formats: list view, report view,
377icon view and small icon view. In any case, elements are numbered from zero.
378For all these modes (but not for virtual list controls), the items are stored
379in the control and must be added to it using InsertItem method.
cf694132 380
8fa876ca
RD
381<p>To intercept events from a list control, use the event table macros described in
382<code>wxListEvent.</code>
cf694132 383
8fa876ca
RD
384<h3>Mix-ins</h3>
385This example demonstrates how to use mixins. The following mixins are available.
cf694132 386
8fa876ca
RD
387<h4>ColumnSorterMixin</h4>
388
389<code><b>ColumnSorterMixin(numColumns)</b></code>
390
391<p>A mixin class that handles sorting of a wxListCtrl in REPORT mode when the column
392header is clicked on.
393
394<p>There are a few requirments needed in order for this to work genericly:
395<p><ol>
396 <li>The combined class must have a <code>GetListCtrl</code> method that returns
397 the ListCtrl to be sorted, and the list control must exist at the time the
398 <code>ColumnSorterMixin.__init__()</code>method is called because it uses
399 <code>GetListCtrl</code>.
400
401 <li>Items in the list control must have a unique data value set with
402 <code>list.SetItemData</code>.
403
404 <li>The combined class must have an attribute named <code>itemDataMap</code>
405 that is a dictionary mapping the data values to a sequence of objects
406 representing the values in each column. These valuesare compared in
407 the column sorter to determine sort order.
408</ol>
409
410<p>Interesting methods to override are <code>GetColumnSorter</code>,
411<code>GetSecondarySortValues</code>, and <code>GetSortImages</code>.
cf694132 412
8fa876ca
RD
413<h5>Methods</h5>
414<dl>
415<dt><code>SetColumnCount(newNumColumns)</code>
416<dd>Informs the mixin as to the number of columns in the control. When it is
417set, it also sets up an event handler for <code>EVT_LIST_COL_CLICK</code> events.
cf694132 418
8fa876ca
RD
419<dt><code>SortListItems(col=-1, ascending=1)</code>
420<dd>Sort the list on demand. Can also be used to set the sort column and order.
cf694132 421
8fa876ca
RD
422<dt><code>GetColumnWidths()</code>
423<dd>Returns a list of column widths. Can be used to help restore the current
424view later.
425
426<dt><code>GetSortImages()</code>
427<dd>Returns a tuple of image list indexes the indexes in the image list for an
428image to be put on the column header when sorting in descending order
429
430<dt><code>GetColumnSorter()</code>
431<dd>Returns a callable object to be used for comparing column values when sorting.
432
433<dt><code>GetSecondarySortValues(col, key1, key2)</code>
434<dd>Returns a tuple of 2 values to use for secondary sort values when the
435items in the selected column match equal. The default just returns the
436item data values.
437
438</dl>
439
440<h4>ListCtrlAutoWidthMixin</h4>
441
d4b73b1b 442<code><b>ListCtrlAutoWidthMixin()</b></code>
8fa876ca
RD
443
444<p>A mix-in class that automatically resizes the last column to take up the
445remaining width of the ListCtrl.
446
447<p>This causes the ListCtrl to automatically take up the full width of the list,
448without either a horizontal scroll bar (unless absolutely necessary) or empty
449space to the right of the last column.
450
451<p><b>NOTE:</b> This only works for report-style lists.
452
453<p><b>WARNING:</b> If you override the <code>EVT_SIZE</code> event in your ListCtrl,
454make sure you call event.Skip() to ensure that the mixin's _OnResize method is
455called.
456
457<p>This mix-in class was written by <a href='mailto:ewestra@wave.co.nz'>Erik Westra </a>
458
459<h5>Methods</h5>
460<dl>
461
462<dt><code>resizeLastColumn(minWidth)</code>
463<dd>Resize the last column appropriately. If the list's columns are too wide to
464fit within the window, we use a horizontal scrollbar. Otherwise, we expand the
465right-most column to take up the remaining free space in the list. This method is
466called automatically when the ListCtrl is resized; you can also call it yourself
467whenever you want the last column to be resized appropriately (eg, when adding,
468removing or resizing columns). 'minWidth' is the preferred minimum width for
469the last column.
470
471</dl>
472
473
474<h4>ListCtrlSelectionManagerMix</h4>
475
476<code><b>ListCtrlSelectionManagerMix()</b></code>
477
478<p>Mixin that defines a platform independent selection policy
479
480<p>As selection single and multi-select list return the item index or a
481list of item indexes respectively.
482
483<h5>Methods</h5>
484<dl>
485
486<dt><code>getPopupMenu()</code>
487<dd>Override to implement dynamic menus (create)
488
489<dt><code>setPopupMenu(menu)</code>
490<dd>Must be set for default behaviour.
491
492<dt><code>afterPopupMenu()</code>
493<dd>Override to implement dynamic menus (destroy).
494
495<dt><code>getSelection()</code>
496<dd>Returns the current selection (or selections as a Python list if extended
497selection is enabled)
498
499
500</body>
501</html>
502"""
cf694132
RD
503
504
3115ef3e
RD
505if __name__ == '__main__':
506 import sys,os
507 import run
8eca4fef 508 run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
cf694132 509