Application badge on dock windows
-
Is there a way to tag minimized windows in the dock with the
application's icon pre 10.5? I know about NSDockTile's
setShowsApplicationBadge: but looking for a 10.4 compatible way to do
this. -
On 29 Feb 2008, at 11:41, mikevann wrote:
> Is there a way to tag minimized windows in the dock with the
> application's icon pre 10.5? I know about NSDockTile's
> setShowsApplicationBadge: but looking for a 10.4 compatible way to
> do this.
Um, my Cocoa app gets this for free in 10.4.
David Dunham A Sharp, LLC
Voice/Fax: 206 783 7404 http://a-sharp.com
Efficiency is intelligent laziness. -
My windows are not getting one on leopard, linked to 10.4U SDK.
On Feb 29, 2008, at 1:13 PM, David Dunham wrote:
> Um, my Cocoa app gets this for free in 10.4.
-
mikevann wrote:
> Is there a way to tag minimized windows in the dock with the
> application's icon pre 10.5? I know about NSDockTile's
> setShowsApplicationBadge: but looking for a 10.4 compatible way to do
> this.
It should just happen. Every app I've got on this 10.4 machine seems
to do it, including a goofy little experiment I threw together
yesterday that makes no active effort to do so. -
On 29 Feb 2008, at 12:18, mikevann wrote:
> My windows are not getting one on leopard, linked to 10.4U SDK.
Maybe you should let us know what you're doing. Perhaps you're not
using NSDocument like I am, or are drawing your own Dock icon?
David Dunham A Sharp, LLC
Voice/Fax: 206 783 7404 http://a-sharp.com
"People seem to misinterpret complexity as sophistication" -- Niklaus
Wirth -
I think it's because I'm using NSUIElement since this is a utility
application. Is my only option to generate the dock image myself?
On Feb 29, 2008, at 2:54 PM, David Dunham wrote:
> On 29 Feb 2008, at 12:18, mikevann wrote:
>
>> My windows are not getting one on leopard, linked to 10.4U SDK.
>
>
> Maybe you should let us know what you're doing. Perhaps you're not
> using NSDocument like I am, or are drawing your own Dock icon?
-
mikevann wrote:
> I think it's because I'm using NSUIElement since this is a utility
> application.
Based on a quick experiment, I'll agree.
> Is my only option to generate the dock image myself?
Yep. Happily it's easy. -
How does one get a quick snapshot of the window?
On Mar 2, 2008, at 2:14 PM, Gregory Weston wrote:
> Yep. Happily it's easy.
-
mikevann wrote:
>> Yep. Happily it's easy.
> How does one get a quick snapshot of the window?
NSWindow>>dataWithPDFInsideRect. Picking the right rect takes some
work, because simply converting the frame from screen coordinates to
window coordinates seems to miss the corners. -
I was just checking if a window server function existed for this, but
I'm using NSBitmapRep's initWithFocusedViewRect: which seems to work
pretty good. Getting the window as PDF had purple squares on the top
corners. Thanks for the help.
On Mar 3, 2008, at 2:25 PM, Gregory Weston wrote:
> NSWindow>>dataWithPDFInsideRect. Picking the right rect takes some
> work, because simply converting the frame from screen coordinates to
> window coordinates seems to miss the corners.
-
On Mar 4, 2008, at 1:26 PM, mikevann wrote:
> I was just checking if a window server function existed for this,
> but I'm using NSBitmapRep's initWithFocusedViewRect: which seems to
> work pretty good. Getting the window as PDF had purple squares on
> the top corners. Thanks for the help.
For Leopard apps, you can also use the new functions in CGWindow.h,
such as CGWindowListCreateImage().
The NSWindow/NSView stuff is easier to use, so you probably only want
the CGWindow API if the other stuff doesn't do what you need it to do.
- Scott



