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.HeaderCtrlSimple
  • Show Source
  • index
  • modules
  • next
  • previous
  • Home
  • Gallery
  • wx

This view

  • Original page
  • New address

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

phoenix_title wx.HeaderCtrlSimple¶

wx.HeaderCtrlSimple is a concrete header control which can be used directly, without inheriting from it as you need to do when using wx.HeaderCtrl itself.

When using it, you need to use simple AppendColumn, InsertColumn and DeleteColumn methods instead of setting the number of columns with SetColumnCount and returning the information about them from the overridden GetColumn

See also

wx.HeaderCtrl


class_hierarchy Class Hierarchy¶

Inheritance diagram for class HeaderCtrlSimple:

Inheritance diagram of HeaderCtrlSimple


method_summary Methods Summary¶

__init__

Default constructor not creating the underlying window.

AppendColumn

Append the column to the end of the control.

DeleteAllColumns

Delete all columns.

DeleteColumn

Delete the column at the given position.

GetBestFittingWidth

This function can be overridden in the classes deriving from this control instead of overriding UpdateColumnWidthToFit .

GetClassDefaultAttributes

HideColumn

Hide the column with the given index.

InsertColumn

Insert the column at the given position.

RemoveSortIndicator

Remove the sort indicator from the column being used as sort key.

ShowColumn

Show or hide the column.

ShowSortIndicator

Update the column sort indicator.


api Class API¶

class wx.HeaderCtrlSimple(HeaderCtrl)¶

Possible constructors:

HeaderCtrlSimple() -> None

HeaderCtrlSimple(parent, winid=ID_ANY, pos=DefaultPosition,
                 size=DefaultSize, style=HD_DEFAULT_STYLE, name=HeaderCtrlNameStr) ->
                 None

HeaderCtrlSimple is a concrete header control which can be used directly, without inheriting from it as you need to do when using HeaderCtrl itself.


Methods¶

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

overload Overloaded Implementations:



__init__ (self)

Default constructor not creating the underlying window.

You must use Create after creating the object using this constructor.

Return type:

None



__init__ (self, parent, winid=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=HD_DEFAULT_STYLE, name=HeaderCtrlNameStr)

Constructor creating the window.

Please see the base class wx.HeaderCtrl.Create method for the parameters description.

Parameters:
  • parent (wx.Window)

  • winid (wx.WindowID)

  • pos (wx.Point)

  • size (wx.Size)

  • style (long)

  • name (string)

Return type:

None





AppendColumn(self, col)¶

Append the column to the end of the control.

Parameters:

col (wx.HeaderColumnSimple)

Return type:

None

See also

InsertColumn



DeleteAllColumns(self)¶

Delete all columns.

Return type:

None

See also

DeleteColumn



DeleteColumn(self, idx)¶

Delete the column at the given position.

Parameters:

idx (int)

Return type:

None

See also

InsertColumn , AppendColumn



GetBestFittingWidth(self, idx)¶

This function can be overridden in the classes deriving from this control instead of overriding UpdateColumnWidthToFit .

To implement automatic column resizing to fit its contents width when the column divider is double clicked, you need to simply return the fitting width for the given column idx from this method, the control will automatically use the biggest value between the one returned from here and the one needed for the display of the column title itself.

The base class version returns -1 indicating that this function is not implemented.

Parameters:

idx (int)

Return type:

int



static GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)¶
Parameters:

variant (WindowVariant)

Return type:

wx.VisualAttributes



HideColumn(self, idx)¶

Hide the column with the given index.

This is the same as calling:

self.ShowColumn(idx, False)
Parameters:

idx (int) – The index of the column to show or hide, from 0 to GetColumnCount .

Return type:

None



InsertColumn(self, col, idx)¶

Insert the column at the given position.

Parameters:
  • col (wx.HeaderColumnSimple) – The column to insert. Notice that because of the existence of implicit conversion from String to wx.HeaderColumn a string can be passed directly here.

  • idx (int) – The position of the new column, from 0 to GetColumnCount . Using GetColumnCount means to append the column to the end.

Return type:

None

See also

AppendColumn



RemoveSortIndicator(self)¶

Remove the sort indicator from the column being used as sort key.

Return type:

None

See also

ShowSortIndicator



ShowColumn(self, idx, show=True)¶

Show or hide the column.

Initially the column is shown by default or hidden if it was added with wx.COL_HIDDEN flag set.

When a column is hidden, it doesn’t appear at all on the screen but its index is still taken into account when working with other columns. E.g. if there are three columns 0, 1 and 2 and the column 1 is hidden you still need to use index 2 to refer to the last visible column.

Parameters:
  • idx (int) – The index of the column to show or hide, from 0 to GetColumnCount .

  • show (bool) – Indicates whether the column should be shown (default) or hidden.

Return type:

None



ShowSortIndicator(self, idx, ascending=True)¶

Update the column sort indicator.

The sort indicator, if shown, is typically an arrow pointing upwards or downwards depending on whether the control contents is sorted in ascending or descending order.

Parameters:
  • idx (int) – The column to set the sort indicator for. If -1 is given, then the currently shown sort indicator will be removed.

  • ascending (bool) – If True or False show the sort indicator corresponding to ascending or descending sort order respectively.

Return type:

None

© 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.