Uncomment line 22 and it works now.
Code: Select all
#Main = 0
#MDIChild = 1
If CreateImage(0, 256, 256, 32, RGB(255,255,255))
StartDrawing(ImageOutput(0))
Ellipse(70, 50, 30, 10, RGB(0,0,255))
Ellipse(186, 50, 30, 10, RGB(0,0,255))
LineXY(128, 80, 128, 150, RGB(255, 0, 255))
RoundBox(70, 200, 110, 30, 20, 20, RGB(255, 0, 0))
StopDrawing()
EndIf
If OpenWindow(#Main, 0, 0, 400, 300, "MDIGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget | #PB_Window_MaximizeGadget)
If CreateMenu(#Main, WindowID(#Main))
MenuTitle("Menu index 0")
MenuTitle("MDI windows menu")
MenuItem(0, "self created item")
MenuItem(1, "self created item")
MDIGadget(0, 0, 0, 0, 0, 1, 2, #PB_MDI_AutoSize)
; SetGadgetAttribute(0,#PB_MDI_Image,ImageID(0)); uncomment this line and the tiled image is ok
SetGadgetAttribute(0,#PB_MDI_TileImage,ImageID(0))
AddGadgetItem(0, #MDIChild, "child window")
; add gadgets here...
UseGadgetList(WindowID(#Main)) ; go back to the main window gadgetlist
EndIf
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf