ça fonctionne comme je voulais .
entre cette solution , et la solution avec le panelgadget j'ai l'embarras du choix maintenant
Code : Tout sélectionner
InitSprite()
If OpenWindow(0,0,0,400,300,#PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_SizeGadget|#PB_Window_MaximizeGadget,"MDIGadget")
;OpenWindowedScreen(WindowID(),0,30,200,200,0,0,0)
If CreateGadgetList(WindowID(0)) And CreateMenu(0, WindowID(0))
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)
AddGadgetItem(0, -1, "Matrix 3D")
hCont = ContainerGadget(1,10,10,200,200,#PB_Container_Double)
If OpenWindowedScreen( hCont, 0, 0, 200, 200, 0, 0, 0 ) = 0
MessageRequester( "Erreur" , "Impossible d'ouvrir l'écran " , 0 )
End
EndIf
; add gadgets here...
AddGadgetItem(0, -1, "Textures")
CloseGadgetList()
EndIf
Repeat
ClearScreen(200,155,255)
FlipBuffers()
Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf
avec le sprite de Chris
Code : Tout sélectionner
InitSprite()
If OpenWindow(0,0,0,400,300,#PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_SizeGadget|#PB_Window_MaximizeGadget,"MDIGadget")
;OpenWindowedScreen(WindowID(),0,30,200,200,0,0,0)
If CreateGadgetList(WindowID(0)) And CreateMenu(0, WindowID(0))
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)
AddGadgetItem(0, -1, "Matrix 3D")
hCont = ContainerGadget(1,10,10,200,200,#PB_Container_Double)
If OpenWindowedScreen( hCont, 0, 0, 200, 200, 0, 0, 0 ) = 0
MessageRequester( "Erreur" , "Impossible d'ouvrir l'écran " , 0 )
End
EndIf
; add gadgets here...
AddGadgetItem(0, -1, "Textures")
CloseGadgetList()
EndIf
If CreateSprite(1000,24,24)
StartDrawing(SpriteOutput(1000))
Box(0,0,24,24,RGB($0,$0,$FF))
StopDrawing()
EndIf
Dep = 8
Repeat
ClearScreen(0,155,255)
DisplaySprite(1000, x, 100)
x + Dep
If x >=200 Or x <=0 : Dep = -Dep : EndIf
FlipBuffers()
Until WindowEvent()=#PB_Event_CloseWindow
EndIf