Snippet #12
Language: C, Author: Karsten
License: Public domain
How to change window tags, in this example it uses the shadow flag, but it can also be used for expose flags, mouse-event transparency and the sticky flag
CGSClearWindowTags will _clear_ the tags that are set in tags and CGSSetWindowTags will _set_ the tags
// this code is from the mouseDown: method of a window // it toggles the shadow of this window on and off CGSConnection cid = _CGSDefaultConnection(); int wid = [self windowNumber]; CGSWindowTag tags[2] = {0,0}; tags[0] = CGSTagNoShadow; if (tag) { // remove the shadow flag CGSClearWindowTags(cid,wid,tags,32); } else { // set the shadow flag CGSSetWindowTags(cid,wid,tags,32); } tag = !tag;
Compatible with:
- Mac OS X 10.2
- Mac OS X 10.3
- Mac OS X 10.4 PPC
- Mac OS X 10.4 Intel
- Mac OS X 10.5 PPC
- Mac OS X 10.5 Intel
Comments
Comment feed
