[wxPython] Printing numbers in wxStyledTextEditor

I've managed to print text using the wxStyledText Editor, but I would also like to print the numbers
in the margin as they appear onscreen along with the text. How do I modify prntxtwx to print the
numbers in the margin as well as my text?

I'm NOT using html text printing. Any help would be appreciated.

Am using wxPython 2.3 on win95.

-- Brian Kirkeby

I've been having some trouble with wxMaskColour.

My program crashes on exit if I don't unselect the mask.
This problem is fixed by adding the following on exit:
   bmp.SetMask(None)

In any case, if I create a wxMask object using wxMaskColour,
the underlying wxMask C++ object leaks. This happens even
if I never use the mask. (AFAIK, the same might happen with
monochome wxMask, but I haven't tried it).

For example, adding the following two lines of dummy code causes a C++
memory leak (the python object is deleted):

    self.mask = wxMaskColour(
            wxBitmap(os.path.join(graphics_dir,mask_name),
wxBITMAP_TYPE_PNG),
            wxColor(255,255,255))
    del self.mask

12:31:58 PM: There were memory leaks.
12:31:58 PM: ----- Memory dump -----
12:31:58 PM: wxMask at $1BEEEC8, size 12
12:31:58 PM: wxMask at $1BEBFE8, size 12
12:31:58 PM: wxMask at $1BEACC8, size 12
12:31:58 PM: wxMask at $1BF2C58, size 12
12:31:58 PM: wxMask at $1BF7DD8, size 12
12:31:58 PM: wxMask at $1BEBEC8, size 12
12:31:58 PM:
12:31:58 PM:
12:31:58 PM: ----- Memory statistics -----
12:31:58 PM: 6 objects of class wxMask, total size 72

(the above code was added to a constructor that is called 6 times)

Using Windows, wxPython 2.3.2.1 hybrid, python 2.2.1

I've been having some trouble with wxMaskColour.

My program crashes on exit if I don't unselect the mask.
This problem is fixed by adding the following on exit:
   bmp.SetMask(None)

I'm not seeing that in the demo, for example with the GenericButtons sample.

In any case, if I create a wxMask object using wxMaskColour,
the underlying wxMask C++ object leaks. This happens even
if I never use the mask.

It will always leak if you don't use it, but if you assign it to a bitmap
then it shouldn't. wxBitmap takes ownership of the mask and will delete it
when the bitmap is destroyed, so the Python wxMask object does not take
ownership of the C++ object, otherwise you'll get a double deletion since
they don't know about each other.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!