Page 1 of 1

How to hide the BadgeLabel?

Posted: Sun Apr 05, 2015 8:46 pm
by Wolfram
can someone tell why this code doesn't work?

Code: Select all

  App = CocoaMessage(0, 0, "NSApplication sharedApplication")
  DockTile = CocoaMessage(0, App, "dockTile")
  CocoaMessage(0, DockTile, "setBadgeLabel:$", @"Hello")
  Delay(1000)
  CocoaMessage(0, DockTile, "setShowsApplicationBadge:", #NO)
  CocoaMessage(0, DockTile, "display")

Re: How to hide the BadgeLabel?

Posted: Mon Apr 06, 2015 7:07 am
by Shardik
Sorry, I don't know why setting setShowsApplicationBadge: to #NO does not work. But using the recommended way is working fine:
NSDockTile reference wrote:To clear the badge string, specify an empty string (@"") or nil.

Code: Select all

OpenWindow(0, 270, 100, 120, 70, "Test")
App = CocoaMessage(0, 0, "NSApplication sharedApplication")
DockTile = CocoaMessage(0, App, "dockTile")
CocoaMessage(0, DockTile, "setBadgeLabel:$", @"Hello")
Delay(3000)
CocoaMessage(0, DockTile, "setBadgeLabel:$", @"")

Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow