Re: Context menu for minimised window
Re: Context menu for minimised window
- Subject: Re: Context menu for minimised window
- From: Rainer Brockerhoff <email@hidden>
- Date: Wed, 31 Oct 2001 17:36:34 -0200
At 17:58 -0800 30/10/2001, Ali Ozer wrote:
Well, I tried setMiniwindowImage and it apparently does nothing -
and the documentation says it works for "collapsed miniwindows",
whatever those are :-), but not for dock tiles.
You need to set a default, which you can do in the context of your
app by registering it at startup. From the AppKit release notes:
There is a user default, AppleDockIconEnabled, to enable setting the
image in a minimized window tile with -[NSWindow
setMiniwindowImage:]. The image will be scaled as necessary to fit
the tile. This behavior is off by default, so you must set
AppleDockIconEnabled to YES if you want to enable this behavior.
Ali, thanks and my apologies... I found your previous response (last
month) to this same question only today.
However.
Drawing the window's image into a bitmap and then calling -[NSWindow
setMiniwindowImage:] seems such a roundabout way to do this. After
all, I just want to update my window's dock icon every couple of
seconds when (for instance) a progress bar changes - not some
arbitrary image, just the real window's contents!
OK, so I set AppleDockIconEnabled to YES. Then... someone suggested
calling UpdateCollapsedWindowDockTile. So I went ahead and, into my
NSWindow subclass, put:
if ([self isMiniaturized]) {
[self display];
UpdateCollapsedWindowDockTile([self windowRef]);
}
and... no effect at all. [self update] and [self flushWindow] also don't work.
It seems that Cocoa disables updating minimized windows somehow...
--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"Originality is the art of concealing your sources."
http://www.brockerhoff.net/ (updated Oct. 2001)