Documentation for Win32lib v0.60.6
Table of Contents
This set of routines helps you to manage Windows resources.
A number of different types of resources are used in Windows programmming. The
main ones are GDI objects, such as Fonts, and Brushes.
Whenever a resource is created by the library, it is tracked so that it can be released back to
Windows when finished with. Typically, a resource is created when you call a drawing routine or
change a font, and a resource is deleted when the drawing routine is fininshed or replaced with
another resource of the same type.
proc deleteObject( object resource ) Deletes a Windows GDI resource.
func findTrackedObject( integer pOwner, sequence pTag ) Looks amongst the tracked objects for one that matches the criteria.
const ForPaint Indicates that the resource lives until the end of the onPaint operation.
const ForProgram Indicates that the resource lives until the end of the program.
func getTrackedObject( object Resource ) Gets the data saved against this Resource
proc trackObject( object owner, object resource, integer lifetime ) Tracks an object as a held resource.
Documentation for Win32lib v0.60.6
Table of Contents
Deletes a Windows GDI resource.
Category: Resources
resource is the Handle of the object to be deleted.
See Also:
findTrackedObject,
ForPaint,
ForProgram,
getTrackedObject,
trackObject
Documentation for Win32lib v0.60.6
Table of Contents
Looks amongst the tracked objects for one that matches the criteria.
Returns: A sequence containing a list of resources matching the criteria.
Category: Resources
pOwner is the ID of the control that owns the resource being tracked.
pTag is the 'tag' data stored with the resource when it was first tracked.
If this is an empty sequence, all resources for this pOwner will be returned.
See Also:
deleteObject,
ForPaint,
ForProgram,
getTrackedObject,
trackObject
Documentation for Win32lib v0.60.6
Table of Contents
Indicates that the resource lives until the end of the onPaint operation.
Category: Resources
See Also:
deleteObject,
findTrackedObject,
ForProgram,
getTrackedObject,
trackObject
Documentation for Win32lib v0.60.6
Table of Contents
Indicates that the resource lives until the end of the program.
Category: Resources
See Also:
deleteObject,
findTrackedObject,
ForPaint,
getTrackedObject,
trackObject
Documentation for Win32lib v0.60.6
Table of Contents
Gets the data saved against this Resource
Returns: A sequence containing the tracking data
Category: Resources
Resource is the resource, eg. Bitmap, Pen, Brush, that was tracked.
If this is an empty sequence, it means that the resource was not being tracked.
See Also:
deleteObject,
findTrackedObject,
ForPaint,
ForProgram,
trackObject
Documentation for Win32lib v0.60.6
Table of Contents
[proc]
trackObject ( object owner, object resource, integer lifetime )
Tracks an object as a held resource.
Category: Resources
owner is the ID of the control that owns the resource being tracked. It
can be a simple control id or a 2-element sequence {id, object-type}. There
are some predefined object types:
resource is the resource being tracked. This is usually a memory address of a structure you have created.
lifetime is how long this resource needs to be kept for. The possible code values are
ForPaint if this a resource held during a Paint operation.
ForProgram if this is to be held for the duration of the application. Win32lib
won't delete this resource. If you need to, you have to explicitly delete it.
Note that resource can be a two-element sequence. The first element is the
actual resource being tracked, and the second is anything you wish to tag
along with the resource. You can then use findTrackedObject() to retrieve
the resource being tracked.
Example:
trackObject (myEdit, hBGBrush, ForProgram)
See Also:
deleteObject,
findTrackedObject,
ForPaint,
ForProgram,
getTrackedObject