Mon 21 Jul 22:43:21 CEST 2025
This commit is contained in:
		
							parent
							
								
									db453e8652
								
							
						
					
					
						commit
						d7cc4b5710
					
				
							
								
								
									
										22
									
								
								js/x11/core/examples/smoketest/shape-rectangles.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								js/x11/core/examples/smoketest/shape-rectangles.js
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,22 @@ | ||||||
|  | var x11 = require('../../lib'); | ||||||
|  | 
 | ||||||
|  | var Expose = 12; | ||||||
|  | 
 | ||||||
|  | x11.createClient(function(err, display) { | ||||||
|  |     var X = display.client; | ||||||
|  |     var root = display.screen[0].root; | ||||||
|  |     X.require('shape', function(err, Shape) { | ||||||
|  |         var win = X.AllocID(); | ||||||
|  |         X.CreateWindow(win, root, 0, 0, 200, 200); | ||||||
|  |         X.ChangeWindowAttributes(win, { backgroundPixel: display.screen[0].black_pixel }); | ||||||
|  |         X.MapWindow(win); | ||||||
|  |         Shape.Rectangles(Shape.Op.Set, Shape.Kind.Bounding, win, 0, 0, [ | ||||||
|  |             [40, 40, 40, 40], [120, 40, 40, 40], | ||||||
|  |             [0, 120, 20, 20], [180, 120, 20, 20], | ||||||
|  |             [20, 140, 30, 20], [150, 140, 30, 20], | ||||||
|  |             [50, 160, 100, 20] | ||||||
|  |         ]); | ||||||
|  |     }); | ||||||
|  |     X.on('error', function(err) { console.log(err); }); | ||||||
|  | 
 | ||||||
|  | }); | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user