++ed by:

4 PAUSE users
2 non-PAUSE users.

أحمد محمد زواوي - Ahmad M. Zawawi

PyFrame Guide to wxPython

Copyright and License information Home

__ A B C D E F G H I L M P R S T U V W

wxStyledTextCtrl - White Space

  • GetViewWhiteSpace

  • SetViewWhiteSpace

  • SetWhitespaceBackground

  • SetWhitespaceForeground


The Whitespace methods are used to control whether or not white space is visible and what its foreground and background colors are.

WxPython defines three 'constants' to control whitespace visibility:

 wxSTC_WS_INVISIBLE                      Duh, white space isn't shown
 wxSTC_WS_VISIBLEALWAYS                  White space is drawn as dots, tabs as arrows
 wxSTC_WS_VISIBLEAFTERINDENT             Dots/arrows only shown after the first visible character



Returns an integer describing the white space mode: one of wxSTC_WS_INVISIBLE, wxSTC_WS_VISIBLEALWAYS, or wxSTC_WS_VISIBLEAFTERINDENT.




The white space mode is set to the value provided as the integer parameter viewWs. The parameter is one of wxSTC_WS_INVISIBLE, wxSTC_WS_VISIBLEALWAYS, or wxSTC_WS_VISIBLEAFTERINDENT. Returns None.



SetWhitespaceBackground(useSetting, back)

SetWhitespaceForeground(useSetting, fore)

These two methods allow you to override the color of visible whitespace. Usually this is controlled by the lexer, but you can override it.

The useSetting parameter is an integer that's 1 to override the lexer or 0 to return to the lexer's control. When useSetting=0 then the value of back or fore is ignored.

The parameters back and fore are a wxColour object, a #RRGGBB string, or a color spec like "white".