GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Table of Contents
  • wx.html.SimpleHtmlListBox
  • Show Source
  • index
  • modules
  • next
  • previous
  • Home
  • Gallery
  • wx.html

This view

  • Original page
  • New address

GeezerVison is showing docs.wxpython.org — wx.html.SimpleHtmlListBox — wxPython 4.3.2 Docs

phoenix_title wx.html.SimpleHtmlListBox¶

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.

styles Window Styles¶

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.

events Events Emitted by this Class¶

Event macros for events emitted by this class:

  • EVT_LISTBOX: Process a wxEVT_LISTBOX event, when an item on the list is selected. See wx.CommandEvent.

  • EVT_LISTBOX_DCLICK: Process a wxEVT_LISTBOX_DCLICK event, when the listbox is double-clicked. See wx.CommandEvent.

  • EVT_HTML_CELL_CLICKED: A wx.html.HtmlCell was clicked. See wx.html.HtmlCellEvent.

  • EVT_HTML_CELL_HOVER: The mouse passed over a wx.html.HtmlCell. See wx.html.HtmlCellEvent.

  • EVT_HTML_LINK_CLICKED: A wx.html.HtmlCell which contains a hyperlink was clicked. See wx.html.HtmlLinkEvent

See also

wx.html.SimpleHtmlListBox.Create


class_hierarchy Class Hierarchy¶

Inheritance diagram for class SimpleHtmlListBox:

Inheritance diagram of SimpleHtmlListBox


method_summary Methods Summary¶

__init__

Constructor, creating and showing the HTML list box.

Create

Creates the HTML listbox for two-step construction.

GetClassDefaultAttributes


api Class API¶

class 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) -> None

SimpleHtmlListBox() -> None

SimpleHtmlListBox is an implementation of HtmlListBox which shows HTML content in the listbox rows.


Methods¶

__init__(self, *args, **kw)¶

overload Overloaded Implementations:



__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:
  • parent (wx.Window) – Parent window. Must not be nullptr.

  • id (wx.WindowID) – Window identifier. A value of -1 indicates a default value.

  • pos (wx.Point) – Window position.

  • size (wx.Size) – Window size. If DefaultSize is specified then the window is sized appropriately.

  • choices (list of strings) – An array of strings with which to initialise the control.

  • style (long) – Window style. See HLB_ flags.

  • validator (wx.Validator) – Window validator.

  • name (string) – Window name.

Return type:

None



__init__ (self)

Default constructor, you must call Create later.

Return type:

None





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:
  • parent (wx.Window)

  • id (wx.WindowID)

  • pos (wx.Point)

  • size (wx.Size)

  • choices (list of strings)

  • style (long)

  • validator (wx.Validator)

  • name (string)

Return type:

bool



static GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)¶
Parameters:

variant (WindowVariant)

Return type:

VisualAttributes

© Copyright 2012-2026, The wxPython Team. Created using Sphinx 9.1.0 and the python-docs-theme.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.