Hier die fast unveränderte Version (die erste, welche kein WinAPI benötigt) unter MacOS X (ich habe nur bei Size 36 und bei Radius 16 eingetragen, um es besser "sehen" zu können):

(Qualität leicht heruntergerechnet)
Code: Alles auswählen
Dim b$(6)
Global hell, dunkel, hintergrund
Global size.f, radius
size.f = 40/7
radius = 2
Procedure ChangeColor(farbe.b)
Select farbe
Case 0
hell = RGB(255,0,0)
dunkel = RGB(96,0,0)
hintergrund = RGB(0,0,0)
Case 1
hell = RGB(0,96,255)
dunkel = RGB(0,32,96)
hintergrund = RGB(192,192,192)
Case 2
hell = RGB(0,255,0)
dunkel = RGB(0,128,0)
hintergrund = RGB(0,96,0)
Case 3
hell = RGB(255,255,0)
dunkel = RGB(0,0,0)
hintergrund = RGB(96,96,96)
EndSelect
EndProcedure
ChangeColor(0)
hwnd = FindWindow_("Shell_TrayWnd",#Null)
hwnd = FindWindowEx_(hwnd,#Null,"TrayNotifyWnd",#Null)
hwnd = FindWindowEx_(hwnd,#Null,"TrayClockWClass",#Null)
GetWindowRect_(hwnd,@Rect.rect)
Window_Width = Rect\right-Rect\left
Window_Height = Rect\bottom-Rect\Top - 4
If OpenWindow(0,0,2,Window_Width,Window_Height,#PB_Window_BorderLess,"Binary Clock")
SetParent_(WindowID(0),hwnd)
SetTimer_(WindowID(0), 0, 200, 0)
CreateImage(0,Window_Width,Window_Height)
If CreateGadgetList(WindowID(0))
ImageGadget(0,0,0,Window_Width,Window_Height,UseImage(0))
Repeat
Select WaitWindowEvent()
Case #PB_Event_Gadget
Select EventType()
Case #PB_EventType_LeftClick
farbe=(farbe+1)%4
ChangeColor(farbe)
Case #PB_EventType_RightClick
quit = #True
EndSelect
Case #PB_Event_CloseWindow
quit = #True
Case #WM_TIMER
b$(1) = RSet(Bin(Val(Left(RSet(Str(Hour(Date())),2,"0"),1))),2,"0")
b$(2) = RSet(Bin(Val(Right(RSet(Str(Hour(Date())),2,"0"),1))),4,"0")
b$(3) = RSet(Bin(Val(Left(RSet(Str(Minute(Date())),2,"0"),1))),3,"0")
b$(4) = RSet(Bin(Val(Right(RSet(Str(Minute(Date())),2,"0"),1))),4,"0")
b$(5) = RSet(Bin(Val(Left(RSet(Str(Second(Date())),2,"0"),1))),3,"0")
b$(6) = RSet(Bin(Val(Right(RSet(Str(Second(Date())),2,"0"),1))),4,"0")
StartDrawing(ImageOutput())
Box(0,0,Window_Width,Window_Height,hintergrund)
For j = 1 To 6
For i = 1 To Len(b$(j))
If Val(Mid(b$(j),i,1))
Circle(j*size,i*size+(4-Len(b$(j)))*size,radius,hell)
Else
Circle(j*size,i*size+(4-Len(b$(j)))*size,radius,dunkel)
EndIf
Next i
Next j
StopDrawing()
SetGadgetState(0,UseImage(0))
EndSelect
Until quit
KillTimer_(WindowID(0), 0(
EndIf
EndIf