Add some code snippets for the docs

This commit is contained in:
Robin Dunn
2020-07-07 16:03:56 -07:00
parent 509de11947
commit 8ed62491e7
5 changed files with 20 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
# Create the initially empty label with the size big enough to show
# the given string.
dc = wx.ClientDC(self)
text = wx.StaticText(
self,
size=dc.GetTextExtent("String of max length"),
style=wx.ST_NO_AUTORESIZE
)

View File

@@ -0,0 +1 @@
# Including headers is not required for Python.

View File

@@ -0,0 +1,5 @@
# For Python the returned GridBlocks object has a __iter__ method so iterating
# in the Python way is possible.
for block in self.grid.GetSelectedBlocks():
do_something(block)

View File

@@ -0,0 +1,5 @@
# For Python the returned GridBlocks object has a __iter__ method so iterating
# in the Python way is possible.
for block in self.grid.GetSelectedBlocks():
do_something(block)