weiß jemand warum ausgerechnet die Buttons davon ausgeschlossen sind?
Ich verwende zwar alternativ PureCOLOR_SetButtonColor aber das macht die .exe nur unnötig größer

Code: Alles auswählen
Procedure CreateColoredButton(Gadget, text$, x, y, width, height, FrontColor, BackColor)
newimage = CreateImage(#PB_Any, width, height)
StartDrawing(ImageOutput(newimage))
Box(0, 0, width, height, BackColor)
If TextWidth(text$) > width Or TextHeight(text$) > height
ProcedureReturn 0
EndIf
newx = (width - TextWidth(text$)) / 2
newy = (height - TextHeight(text$)) / 2
DrawText(newx, newy, text$, FrontColor, BackColor)
StopDrawing()
ButtonImageGadget(Gadget, x, y, width, height, ImageID(newimage))
EndProcedure
Procedure SetColorAndTextOfAButton(Gadget, text$, FrontColor, BackColor)
width = GadgetWidth(Gadget)
height = GadgetHeight(Gadget)
newimage = CreateImage(#PB_Any, width, height)
StartDrawing(ImageOutput(newimage))
Box(0, 0, ImageWidth(newimage), ImageHeight(newimage), BackColor)
If TextWidth(text$) > width Or TextHeight(text$) > height
ProcedureReturn 0
EndIf
newx = (width - TextWidth(text$)) / 2
newy = (height - TextHeight(text$)) / 2
DrawText(newx, newy, text$, FrontColor, BackColor)
StopDrawing()
SetGadgetAttribute(Gadget, #PB_Button_Image, ImageID(newimage))
EndProcedure
OpenWindow(0, 0, 0, 200, 200, "Farbige Buttons", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
CreateGadgetList(WindowID(0))
CreateColoredButton(0, "Klick mich!", 20, 20, 100, 30, 0, RGB(255, 0, 0))
Repeat
EventID = WindowEvent()
If EventID = #PB_Event_CloseWindow
End
ElseIf EventID = #PB_Event_Gadget
If EventGadget() = 0
SetColorAndTextOfAButton(0, "Werde Gruen!", 0, RGB(0, 255, 0))
EndIf
EndIf
ForEver