Code : Tout sélectionner
EnableExplicit
Enumeration Window
#WdwMain
EndEnumeration
Global WdwLargeur.i = 800 ; La Largeur de la fenêtre.
Global WdwHauteur.i = 600 ; La Hauteur de la fenêtre.
Global WdwOptions.i = #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_ScreenCentered
Global uX.i ; Espace entre 2 lignes verticales.
Global uY.i ; Espace entre 2 lignes horizontales.
Declare Exit()
Declare Paint()
Procedure WdwMain()
; Ouverture de la fenêtre.
OpenWindow(#WdwMain, 0, 0, WdwLargeur, WdwHauteur, "Représentation graphique", WdwOptions.i)
; On place un Callback pour la fermeture de la fenêtre.
BindEvent(#PB_Event_CloseWindow, @Exit(), #WdwMain)
; On place un Callback pour le repaint de la fenêtre.
BindEvent(#PB_Event_SizeWindow, @Paint(), #WdwMain)
Paint();
EndProcedure
Procedure Exit()
End
EndProcedure
Procedure Paint()
uX.i = Int(WindowWidth(EventWindow())/10)
uY.i = Int(WindowHeight(EventWindow())/10)
EndProcedure
; Ouverture de la fenêtre.
WdwMain()
Repeat
WaitWindowEvent(1)
ForEver
Je rajoute la déclaration (uniquement la déclaration) de ma fameuse fenêtre de correction de bug pour le dualscreen
Code : Tout sélectionner
EnableExplicit
Enumeration Window
#WdwGosht
#WdwMain
EndEnumeration
Global WdwLargeur.i = 800 ; La Largeur de la fenêtre.
Global WdwHauteur.i = 600 ; La Hauteur de la fenêtre.
Global WdwOptions.i = #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_ScreenCentered
Global uX.i ; Espace entre 2 lignes verticales.
Global uY.i ; Espace entre 2 lignes horizontales.
Declare Exit()
Declare Paint()
Procedure WdwMain()
; Ouverture de la fenêtre.
OpenWindow(#WdwMain, 100, 100, WdwLargeur, WdwHauteur, "Représentation graphique", WdwOptions.i)
; On place un Callback pour la fernmeture de la fenêtre.
BindEvent(#PB_Event_CloseWindow, @Exit(), #WdwMain)
; On place un Callback pour le repaint de la fenêtre.
BindEvent(#PB_Event_SizeWindow, @Paint(), #WdwMain)
Paint();
EndProcedure
Procedure Exit()
End
EndProcedure
Procedure Paint()
uX.i = Int(WindowWidth(EventWindow())/10)
uY.i = Int(WindowHeight(EventWindow())/10)
EndProcedure
; Ouverture de la fenêtre.
WdwMain()
Repeat
WaitWindowEvent(1)
ForEver
Je corrige le tir :[15:44:38] Waiting for executable to start...
[15:44:38] Executable type: MacOSX - x64 (64bit, Unicode)
[15:44:38] Executable started.
[15:44:38] [ERROR] Line: 29
[15:44:38] [ERROR] The specified #Window is not initialised.
Code : Tout sélectionner
EnableExplicit
Enumeration Window
#WdwGosht
#WdwMain
EndEnumeration
Global WdwLargeur.i = 800 ; La Largeur de la fenêtre.
Global WdwHauteur.i = 600 ; La Hauteur de la fenêtre.
Global WdwOptions.i = #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_ScreenCentered
Global uX.i ; Espace entre 2 lignes verticales.
Global uY.i ; Espace entre 2 lignes horizontales.
Declare Exit()
Declare Paint()
Procedure WdwMain()
; Ouverture de la fenêtre.
OpenWindow(#WdwMain, 100, 100, WdwLargeur, WdwHauteur -1, "Représentation graphique", WdwOptions.i)
; On place un Callback pour la fernmeture de la fenêtre.
BindEvent(#PB_Event_CloseWindow, @Exit(), #WdwMain)
; On place un Callback pour le repaint de la fenêtre.
BindEvent(#PB_Event_SizeWindow, @Paint(), #WdwMain)
WdwHauteur = WdwHauteur +1;
ResizeWindow(#WdwMain, #PB_Ignore, #PB_Ignore, #PB_Ignore, WdwHauteur) (avec une hauteur différente pour Repaint()
EndProcedure
Procedure Exit()
End
EndProcedure
Procedure Paint()
uX.i = Int(WindowWidth(EventWindow())/10)
uY.i = Int(WindowHeight(EventWindow())/10)
EndProcedure
; Ouverture de la fenêtre.
WdwMain()
Repeat
WaitWindowEvent(1)
ForEver
Merci pour vous lumières. Gilles