wx.html.SimpleHtmlListBox is an implementation of wx.html.HtmlListBox which shows HTML content in the listbox rows.
Unlike wx.html.HtmlListBox, this is not an abstract class and thus it has the advantage that you can use it without deriving your own class from it. However, it also has the disadvantage that this is not a virtual control and thus it’s not well-suited for those cases where you need to show a huge number of items: every time you add/insert a string, it will be stored internally and thus will take memory.
The interface exposed by wx.html.SimpleHtmlListBox fully implements the wx.ControlWithItems interface, thus you should refer to wx.ControlWithItems‘s documentation for the API reference for adding/removing/retrieving items in the listbox. Also note that the wx.VListBox.SetItemCount
function is protected
in wx.html.SimpleHtmlListBox‘s context so that you cannot call it directly, wx.html.SimpleHtmlListBox will do it for you.
Note: in case you need to append a lot of items to the control at once, make sure to use the Append
function.
Thus the only difference between a wx.ListBox and a wx.html.SimpleHtmlListBox is that the latter stores strings which can contain HTML fragments (see the list of tags supported by wxHTML).
Note that the HTML strings you fetch to wx.html.SimpleHtmlListBox should not contain the <html>
or <body>
tags.
This class supports the following styles:
wx.html.HLB_DEFAULT_STYLE
: The default style: wx.BORDER_SUNKEN
wx.html.HLB_MULTIPLE
: Multiple-selection list: the user can toggle multiple items on and off.A wx.html.SimpleHtmlListBox emits the same events used by wx.ListBox and by wx.html.HtmlListBox.
Event macros for events emitted by this class:
wxEVT_LISTBOX
event, when an item on the list is selected. See wx.CommandEvent.wxEVT_LISTBOX_DCLICK
event, when the listbox is double-clicked. See wx.CommandEvent.See also
__init__ |
Constructor, creating and showing the HTML list box. |
Create |
Creates the HTML listbox for two-step construction. |
wx.html.
SimpleHtmlListBox
(HtmlListBox, ItemContainer)¶Possible constructors:
SimpleHtmlListBox(parent, id=ID_ANY, pos=DefaultPosition,
size=DefaultSize, choices=[], style=HLB_DEFAULT_STYLE,
validator=DefaultValidator, name=SimpleHtmlListBoxNameStr)
SimpleHtmlListBox()
SimpleHtmlListBox is an implementation of HtmlListBox which shows HTML content in the listbox rows.
__init__
(self, *args, **kw)¶__init__ (self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, choices=[], style=HLB_DEFAULT_STYLE, validator=DefaultValidator, name=SimpleHtmlListBoxNameStr)
Constructor, creating and showing the HTML list box.
Parameters: |
|
---|
__init__ (self)
Default constructor, you must call Create
later.
Create
(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, choices=[], style=HLB_DEFAULT_STYLE, validator=DefaultValidator, name=SimpleHtmlListBoxNameStr)¶Creates the HTML listbox for two-step construction.
See wx.html.SimpleHtmlListBox for further details.
Parameters: |
|
---|---|
Return type: | bool |