Dies hilft vielleicht dir weiter. Die Procedure kommt aus
www.purearea.net
(
http://purearea.net/pb/german/index.htm ) , welche ich dir hinzugefügt
habe. Damit kannst du beides Text-, und Button-Color nutzen.
Die überflüssigen Nullen habe ich aus deinem Source entfernt.
Code: Alles auswählen
Procedure COLOR_BUTTON(id.l,x.l,y.l,w.l,h.l,color.l,textcolor.l,text.s)
jetztaber:
box.l = CreateImage(id, w,h)
StartDrawing(ImageOutput(id))
If TextWidth(text) <= w
posx.l = w/2 -TextWidth(text) / 2
Else
w = TextWidth(text) + 20
StopDrawing()
Goto jetztaber
EndIf
posy.l=h/2-TextWidth("Xii")/2
Box(0, 0,w, h,color)
DrawingMode(1)
FrontColor(RGB(Red(textcolor),Green(textcolor),Blue(textcolor)))
DrawText(posx, posy,text)
StopDrawing()
ButtonImageGadget(id, x, y, w, h,box)
EndProcedure
If OpenWindow(0,0,0,800,50,"Relais Butler",#PB_Window_SystemMenu|#PB_Window_MinimizeGadget)
If CreateGadgetList(WindowID(0))
;Relais 1
COLOR_BUTTON(0,34,8,65,20,$FF0000,$000000,"Licht Ein")
COLOR_BUTTON(1,109,8,65,20,$00FF00,$FFFFFF,"Licht Aus")
EndIf
EndIf
Repeat:Until WaitWindowEvent()=#PB_Event_CloseWindow
Gruß, Falko