| Index | Submit class | Submit snippet | Submission feed | List |

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:


Comments

Name

Website

Do you hate spammers? (Answer "Yes")