wxbrushlista brush list is a list containing all brushes which have been created. derived from include files <wx/gdicmn.h> remarks there is only one instance of this class: wxthebrushlist. use this object to search for a previously created brush of the desired type and create it if not already found. in some windowing systems, the brush may be a scarce resource, so it can pay to reuse old resources if possible. when an application finishes, all brushes will be deleted and their resources freed, eliminating the possibility of 'memory leaks'. however, it is best not to rely on this automatic cleanup because it can lead to double deletion in some circumstances. there are two mechanisms in recent versions of wxwidgets which make the brush list less useful than it once was. under windows, scarce resources are cleaned up internally if they are not being used. also, a reference counting mechanism applied to all gdi objects means that some sharing of underlying resources is possible. you don't have to keep track of pointers, working out when it is safe delete a brush, because the reference counting does it for you. for example, you can set a brush in a device context, and then immediately delete the brush you passed, because the brush is 'copied'. so you may find it easier to ignore the brush list, and instead create and copy brushes as you see fit. if your windows resource meter suggests your application is using too many resources, you can resort to using gdi lists to share objects explicitly. the only compelling use for the brush list is for wxwidgets to keep track of brushes in order to clean them up on exit. it is also kept for backward compatibility with earlier versions of wxwidgets. see also members
wxbrushlist::wxbrushlist
wxbrushlist::wxbrushlistvoid wxbrushlist() constructor. the application should not construct its own brush list: use the object pointer wxthebrushlist.
wxbrushlist::findorcreatebrushwxbrush * findorcreatebrush(const wxcolour& colour, int style = wxsolid) finds a brush with the specified attributes and returns it, else creates a new brush, adds it to the brush list, and returns it. parameters colour
style
|