Page 1 of 1

SetSystrayWidth

Posted: Sun Sep 18, 2016 12:08 pm
by mk-soft
Change Systray width for Mac OS
I missing SysTrayID, but you can get it over IsSystrayIcon. (PB-Internal)

Code: Select all

; PB-Internal
Macro SystrayID(Systray)
  PeekI(IsSysTrayIcon(Systray))
EndMacro

Procedure SetSystrayWidth(Systray, Width)
  Protected StatusItem, ItemLength.cgfloat
  ItemLength = Width
  StatusItem = CocoaMessage(0, SystrayID(Systray), "retain")
  CocoaMessage(0, StatusItem, "setLength:@", @ItemLength)
EndProcedure
:wink:

Re: SetSystrayWidth

Posted: Fri Sep 23, 2016 11:52 am
by deseven
If you don't want to calculate anything you can use NSVariableStatusItemLength (-1) as a width.