Version: 1.0
Date: Le 13 août 1997
Rédaction: Jocelyn Houle
Direction: Jean Vaucher
BEGIN EXTERNAL CLASS WindowTools; MainWindow CLASS MyMainWindow; BEGIN REF(SelectionListWindow) SLW; REF(Button) Ok; INTEGER i; PROCEDURE Selection_Handler(Wnd, Line, LineNbr); REF(XWindow) Wnd; TEXT Line; INTEGER LineNbr; BEGIN OutText(Line); OutImage; END; SetBackground("gray"); SLW :- MakeSelectionListWindow.SetTextSize(25, 10); FOR i := 1 STEP 1 UNTIL 10 DO SLW.PutLine("Ligne " & int_as_text(i)); Ok :- MakeButton("Ok").PlaceRightBelow(SLW); SetSizeToSubwindowSize; Show; Ok.Wait; END; NEW MyMainWindow("SelectionListWindow"); END;
La création d'une SelectionListWindow se fait à l'aide d'un MakeSelectionListWindow.
On a ensuite réglé la taille à 25 colonnes par 10 lignes. Puis on a inséré dix lignes numérotées de 1 à 10.
|
Pour que le Selection_Handler fonctionne, il faut que le définir dans une nouvelle classe. C'est pourquoi dans l'exemple, nous avons créé la classe MyMainWindow...
Pour d'autres fonctions accessibles dans les SelectionListWindows référez-vous aux TextAreas...