How to change color of NSSearchField?
Posted: Sat Feb 18, 2017 11:31 am
How can I change the background color of a NSSearchField?
Code: Select all
Global Window_0
Procedure OpenWindow_0(x = 0, y = 0, width = 450, height = 160)
Window_0 = OpenWindow(#PB_Any, x, y, width, height, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
Frame.NSRect
Frame\origin\x = 164
Frame\origin\y = 10
Frame\size\width = 120
Frame\size\height = 25
CocoaMessage(@SearchField, #Null, "NSSearchField alloc")
CocoaMessage(0, SearchField, "initWithFrame:@", @Frame)
CocoaMessage(@contentView, WindowID(Window_0), "contentView")
CocoaMessage(0, contentView, "addSubview:", SearchField)
CocoaMessage(0, SearchField, "cell")
EndProcedure
Procedure Window_0_Events(event)
Select event
Case #PB_Event_CloseWindow
ProcedureReturn #False
Case #PB_Event_Menu
Select EventMenu()
Case #PB_Menu_Quit
ProcedureReturn #False
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
ProcedureReturn #True
EndProcedure
OpenWindow_0()
Repeat
event = WaitWindowEvent()
Until Window_0_Events(event) = #False
End