setDefaultButtonCell crashes in Thread-save
Posted: Wed May 13, 2015 10:25 pm
Can someone tell me why this code freeze if I type a view Letters in the StringGadget?
This is happened in Thread-save mode only and with the "setDefaultButtonCell".
This is happened in Thread-save mode only and with the "setDefaultButtonCell".
Code: Select all
Window = OpenWindow(#PB_Any,0,0,400,160, "", #PB_Window_SystemMenu|#PB_Window_TitleBar|#PB_Window_ScreenCentered)
OKButton = ButtonGadget(#PB_Any, WindowWidth(Window) - 70, WindowHeight(Window) - 30, 60, 25, "OK")
ESCButton = ButtonGadget(#PB_Any, 10, WindowHeight(Window) - 30, 100, 25, "Cancel")
ButtonCell = CocoaMessage(0,GadgetID(OKButton),"cell")
; CocoaMessage(0,GadgetID(OKKnopf),"setBezelStyle:", #NSRoundedBezelStyle)
CocoaMessage(0,WindowID(Window),"setDefaultButtonCell:", ButtonCell)
InputString = StringGadget(#PB_Any,140,WindowHeight(Window) - 80, 118, 20,"")
Repeat
event = WaitWindowEvent()
Select event
Case #PB_Event_CloseWindow
Exit = #True
EndSelect
Until Exit = #True