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

This view

  • Original page
  • New address

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

phoenix_title wx.grid.GridUpdateLocker¶

This small class can be used to prevent wx.grid.Grid from redrawing during its lifetime by calling wx.grid.Grid.BeginBatch in its constructor and wx.grid.Grid.EndBatch in its destructor.

It is typically used in a function performing several operations with a grid which would otherwise result in flicker. For example:

def GridLocker(self):

    self.grid = wx.grid.Grid(self, -1)

    noUpdates = wx.grid.GridUpdateLocker(self.grid)
    self.grid.AppendColumn()
    # ... many other operations with self.grid ...
    self.grid.AppendRow()

    # destructor called, grid refreshed

Using this class is easier and safer than calling wx.grid.Grid.BeginBatch and wx.grid.Grid.EndBatch because you don’t risk missing the call the latter (due to an exception for example).


class_hierarchy Class Hierarchy¶

Inheritance diagram for class GridUpdateLocker:

Inheritance diagram of GridUpdateLocker


method_summary Methods Summary¶

__init__

Creates an object preventing the updates of the specified grid.

Create

This method can be called if the object had been constructed using the default constructor.

__enter__

__exit__


api Class API¶

class wx.grid.GridUpdateLocker(object)¶

Possible constructors:

GridUpdateLocker(grid=None) -> None

This small class can be used to prevent Grid from redrawing during its lifetime by calling Grid.BeginBatch() in its constructor and Grid.EndBatch() in its destructor.


Methods¶

__init__(self, grid=None)¶

Creates an object preventing the updates of the specified grid.

The parameter could be nullptr in which case nothing is done. If grid is non-null then the grid must exist for longer than this wx.grid.GridUpdateLocker object itself.

The default constructor could be followed by a call to Create to set the grid object later.

Parameters:

grid (wx.grid.Grid)

Return type:

None



Create(self, grid)¶

This method can be called if the object had been constructed using the default constructor.

It must not be called more than once.

Parameters:

grid (wx.grid.Grid)

Return type:

None



__enter__(self)¶


__exit__(self, exc_type, exc_val, exc_tb)¶
© 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.