Page 1 of 1

Potential problem in openwindow

Posted: Wed Nov 16, 2011 5:52 pm
by jesperbrannmark
I use lion and pb 4.6. I wanted to post this here before making a big fuss in the bug reports.

When opening a window we use #pb_window_systemmenu to have the close, maximize, minimize buttons there.
If I close a window and then open it up, the closebutton is there. Anyone can confirm?

Code: Select all

OpenWindow(0,0,0,1024,800,"Window")
StringGadget(0,0,0,1024,800,"Close me")
Repeat
Until WaitWindowEvent(5)=#PB_Event_CloseWindow
CloseWindow(0)

OpenWindow(0,0,0,1024,800,"Window")
StringGadget(0,0,0,1024,800,"I dont have a close button - no #pb_window_systemmenu")
Repeat
Until WaitWindowEvent(5)=#PB_Event_CloseWindow
CloseWindow(0)

Re: Potential problem in openwindow

Posted: Wed Nov 16, 2011 6:01 pm
by wilbert
I think it has to do with the coordinates.
If the window is placed below the menu bar the problem doesn't exist.

Code: Select all

OpenWindow(0,0,40,1024,800,"Window")
StringGadget(0,0,40,1024,800,"Close me")
Repeat
Until WaitWindowEvent(5)=#PB_Event_CloseWindow
CloseWindow(0)

OpenWindow(0,0,40,1024,800,"Window")
StringGadget(0,0,40,1024,800,"I dont have a close button - no #pb_window_systemmenu")
Repeat
Until WaitWindowEvent(5)=#PB_Event_CloseWindow
CloseWindow(0)

Re: Potential problem in openwindow

Posted: Wed Nov 16, 2011 6:20 pm
by jesperbrannmark
#PB_Window_ScreenCentered| #PB_Window_SystemMenu
Also works as flags - setting the window to center of screen.
thanks