wxBrush(3erl)
πΈ NAME πΈ
okay so this is the Erlang Module Definition manual page for wxBrush(3erl), bestie β literally Functions for wxBrush class, and we're gonna get into it. periodt. β¨
β¨ DESCRIPTION β¨
A brush is a drawing tool for filling in areas. It's used for painting the background of rectangles, ellipses, etc. It has a colour and a style. π
On a monochrome display, wxWidgets shows all brushes as white unless the colour is really black. not me checking if my black is really black π
Do not initialize objects on the stack before the program commences, since other required structures may not have been set up yet. Instead, define global pointers to objects and create them in wxApp::OnInit (not implemented in wx) or when required. π«Ά
An application may wish to create brushes with different characteristics dynamically, and there is the consequent danger that a large number of duplicate brushes will be created. Therefore an application may wish to get a pointer to a brush by using the global list of brushes ?wxTheBrushList, and calling the member function wxBrushList::FindOrCreateBrush() (not implemented in wx). lowkey iconic, but watch those duplicates, bestie π
This class uses reference counting and copy-on-write internally so that assignments between two instances of this class are very cheap. You can therefore use actual objects instead of pointers without efficiency problems. If an instance of this class is changed it will create its own data internally so that other instances, which previously shared the data using the reference counting, are not affected. that's the copy-on-write slay π
Predefined objects (include wx.hrl): β the original just leaves it at that, bestie, no list, no cap π«Ά
See: wxBrushList (not implemented in wx), wxDC, wxDC:setBrush/2
wxWidgets docs: wxBrush
π DATA TYPES π
wxBrush() = wx:wx_object()
one type, simple, iconic. π
π EXPORTS π
new() -> wxBrush()β Default constructor. The brush will be uninitialised, andwxBrush:isOk/1will returnfalse.new(Colour) -> wxBrush()β that's the whole line the page gives, bestie; no extra deets on this overload π«Άnew(Brush) -> wxBrush()β Types:Brush = wxBrush:wxBrush() | wxBitmap:wxBitmap(). Copy constructor, uses reference counting.new(Colour, Options :: [Option]) -> wxBrush()β Types:Colour = wx:wx_colour(),Option = {style, wx:wx_enum()}. Constructs a brush from a colour object and style.destroy(This :: wxBrush()) -> okβ Destructor. Seeoverview_refcount_destructfor more info.
Remark: Although all remaining brushes are deleted when the application exits, the application should try to clean up all brushes itself. This is because wxWidgets cannot know if a pointer to the brush object is stored in an application data structure, and there is a risk of double deletion. π
getColour(This) -> wx:wx_colour4()β Types:This = wxBrush(). Returns a reference to the brush colour. See:setColour/4.getStipple(This) -> wxBitmap:wxBitmap()β Types:This = wxBrush(). Gets a pointer to the stipple bitmap. If the brush does not have awxBRUSHSTYLE_STIPPLEstyle, this bitmap may be non-NULL but uninitialised (i.e.wxBitmap:isOk/1returnsfalse). See:setStipple/2.getStyle(This) -> wx:wx_enum()β Types:This = wxBrush(). Returns the brush style, one of the?wxBrushStylevalues. See:setStyle/2,setColour/4,setStipple/2.isHatch(This) -> boolean()β Types:This = wxBrush(). Returnstrueif the style of the brush is any of hatched fills. See:getStyle/1.isOk(This) -> boolean()β Types:This = wxBrush(). Returnstrueif the brush is initialised.
Notice: an uninitialized brush object can't be queried for any brush properties and all calls to the accessor methods on it will result in an assert failure. π
setColour(This, Colour) -> okβ Types:This = wxBrush(),Colour = wx:wx_colour(). Sets the brush colour using red, green and blue values. See:getColour/1.setColour(This, Red, Green, Blue) -> okβ Types:This = wxBrush(),Red = Green = Blue = integer().setStipple(This, Bitmap) -> okβ Types:This = wxBrush(),Bitmap = wxBitmap:wxBitmap(). Sets the stipple bitmap. See:wxBitmap.
Remark: The style will be set towxBRUSHSTYLE_STIPPLE, unless the bitmap has a mask associated to it, in which case the style will be set towxBRUSHSTYLE_STIPPLE_MASK_OPAQUE. π
setStyle(This, Style) -> okβ Types:This = wxBrush(),Style = wx:wx_enum(). Sets the brush style. See:getStyle/1.
mwah π source/version vibes: the wxWidgets team, wx 2.2.2.1, on the wxBrush(3erl) page β that's the footer, periodt. π
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms