[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

test[x11] display

SwikiCodeRobot @> #testX11Display

"Creating a display for testing"
MyDisplay := X11 current XOpenDisplay: nil json.
MyDisplay = 0 ifTrue: [
	self print: 'Error allocating display for testing'.
	^self abortPage 
].

"Get the default screen and display information"
| number |
MyScreen     := X11 current XDefaultScreenOfDisplay: MyDisplay.
number       := X11 current XScreenNumberOfScreen: MyScreen.
MyVisual     := X11 current XDefaultVisual: MyDisplay screenNumber: number.
MyDepth      := X11 current XDefaultDepth: MyDisplay screenNumber: number.
MyColormap   := X11 current XDefaultColormap: MyDisplay screenNumber: number.
MyRootWindow := X11 current XRootWindow: MyDisplay screenNumber: number.



"End of display tests"
X11 current XFlush: MyDisplay.
#( MyDisplay MyScreen MyVisual MyDepth MyColormap MyRootWindow
) do: [:key| Smalltalk removeKey: key ifAbsent: [] ].