Mac only! I wanted to get this to work on a Mac and this is what I came up with. I found I had to add
|#PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget/i] to get it to work and #PB_Window_SystemMenu had to be added to be able to close the window. When the window 'minimizes' it goes into the Dock. (which I happen to like and use)
Code: Select all
Enumeration
#oWin
#oButton
#nButton
#oImgBtn
EndEnumeration
If CreateImage(#oImgBtn,100,30)
If StartDrawing(ImageOutput(#oImgBtn))
Box(0,0,100,30,$99FF99)
DrawingMode(#PB_2DDrawing_Transparent)
DrawText(4,10,"Minimize",0)
StopDrawing()
EndIf
EndIf
OpenWindow(#oWin,0,30,340,200,"Window sizes", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget)
ButtonGadget(#oButton,10,10,100,30,"Maximize")
ImageGadget(#oImgBtn,130,10,100,30,ImageID(#oImgBtn),#PB_Image_Border)
ButtonGadget(#nButton,240,10,100,30,"Normalize")
Repeat
event=WaitWindowEvent()
Select event
Case #PB_Event_Gadget
Select EventGadget()
Case #oButton
SetWindowState(#oWin,#PB_Window_Maximize)
Case #oImgBtn
SetWindowState(#oWin,#PB_Window_Minimize)
Case #nButton
SetWindowState(#oWin,#PB_Window_Normal)
EndSelect
EndSelect
Until event=#PB_Event_CloseWindow