Page 1 of 1

setDefaultButtonCell crashes in Thread-save

Posted: Wed May 13, 2015 10:25 pm
by Wolfram
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".

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

Re: setDefaultButtonCell crashes in Thread-save

Posted: Thu May 14, 2015 5:34 am
by wilbert
Wolfram wrote: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".
Your code seems to work fine here.

Re: setDefaultButtonCell crashes in Thread-save

Posted: Thu May 14, 2015 9:55 am
by Wolfram
Hi Wilbert,

type a view letters and delete them with backspace, then repeat this a view times.
It will crash!

I tried it on three machines. OSX 10.6.8, 10.7.5 and 10.9.4.

Re: setDefaultButtonCell crashes in Thread-save

Posted: Thu May 14, 2015 11:47 am
by wilbert
I tried PB 5.31 (x64) and 5.24(x86) on OS X 10.10.3 and I can't get it to crash.

Re: setDefaultButtonCell crashes in Thread-save

Posted: Thu May 14, 2015 1:39 pm
by Wolfram
Can someone else verify it?
And don't forget to turn on the Thread-save option.

Thanks

Re: setDefaultButtonCell crashes in Thread-save

Posted: Fri May 15, 2015 8:43 pm
by mk-soft
PB 5.31 (x64) and 5.24(x64) on OS X 10.10.3

no crash her