code
stringlengths
1
1.72M
language
stringclasses
1 value
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import shutil import sys # Bump pyglet/__init__.py version as well. VERSION = '1.2alpha1' long_description = '''pyglet provides an object-oriented programming interface for developing games and other visually-rich appli...
Python
#!/usr/bin/python # $Id:$ import os import sys import unittest from pyglet.gl import * from pyglet import image from pyglet import resource from pyglet import window __noninteractive = True # Test image is laid out # M R # B G # In this test the image is sampled at four points from top-right cloc...
Python
#!/usr/bin/python # $Id:$ import os import sys import unittest from pyglet.gl import * from pyglet import image from pyglet import resource from pyglet import window __noninteractive = True # Test image is laid out # M R # B G # In this test the image is sampled at four points from top-right cloc...
Python
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' __noninteractive = True ''' Layout: . (script home) file.txt F1 dir1/ file.txt F2 dir1/ file.txt F3 res.zip/...
Python
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' __noninteractive = True ''' Layout: . (script home) file.txt F1 dir1/ file.txt F2 dir1/ file.txt F3 res.zip/...
Python
#!/usr/bin/env python '''Test that rendering of bullet glyphs works. You should see 5 bullet glyphs rendered in the bottom-left of the window. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest from pyglet import font import base_text class TEST_HALIGN(base_text.TextTestBase): font...
Python
#!/usr/bin/env python '''Test that text will not wrap when its width is set to its calculated width. You should be able to clearly see "TEST TEST" on a single line (not two) and "SPAM SPAM SPAM" over two lines, not three. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest import base_text...
Python
#!/usr/bin/env python '''Test that a font likely to be installed on the computer can be loaded and displayed correctly. One window will open, it should show "Quickly brown fox" at 24pt using: * "Helvetica" on Mac OS X * "Arial" on Windows ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import un...
Python
#!/usr/bin/env python '''Base class for text tests. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest import sys from pyglet.gl import * from pyglet import font from pyglet.window import * from pyglet.window.event import * from tests.regression import ImageRegressionTestCase class Text...
Python
#!/usr/bin/env python '''Test that font.Text alignment works with multiple lines. Three labels will be rendered at the top-left, center and bottom-right of the window. Resize the window to ensure the alignment is as specified. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest from pygl...
Python
#!/usr/bin/env python '''Test that text will not wrap when its width is set to its calculated width. You should be able to clearly see "TEST TEST" on a single line (not two) and "SPAM SPAM SPAM" over two lines, not three. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest import base_text...
Python
#!/usr/bin/env python '''Test that the horizontal font metrics are calculated correctly. Some text in various fonts will be displayed. Green vertical lines mark the left edge of the text. Blue vertical lines mark the right edge of the text. Press ESC to end the test. ''' __docformat__ = 'restructuredtext' __versi...
Python
#!/usr/bin/env python '''Test that font colour is applied correctly. Default font should appear blue. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest import base_text from pyglet import font class TEST_COLOR(base_text.TextTestBase): def render(self): fnt = font.load(self.f...
Python
#!/usr/bin/env python '''Test that text will not wrap when its width is set to its calculated width. You should be able to clearly see "TEST TEST" on a single line (not two) and "SPAM SPAM SPAM" over two lines, not three. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest import base_text...
Python
#!/usr/bin/env python '''Test that the horizontal font metrics are calculated correctly. Some text in various fonts will be displayed. Green vertical lines mark the left edge of the text. Blue vertical lines mark the right edge of the text. Press ESC to end the test. ''' __docformat__ = 'restructuredtext' __versi...
Python
#!/usr/bin/env python '''Test that a font distributed with the application can be displayed. Four lines of text should be displayed, each in a different variant (bold/italic/regular) of Action Man at 24pt. The Action Man fonts are included in the test directory (tests/font) as action_man*.ttf. Press ESC to end the ...
Python
#!/usr/bin/env python '''Test that a specific DPI can be set to render the text with. Some text in Action Man font will be displayed. A green box should exactly bound the top and bottom of the text. Press ESC to end the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import os import unittest ...
Python
#!/usr/bin/env python '''Test that font.Text horizontal alignment works. Three labels will be rendered aligned left, center and right. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest from pyglet import font import base_text class TEST_HALIGN(base_text.TextTestBase): font_name = ...
Python
#!/usr/bin/env python '''Test that font.Text vertical alignment works. Four labels will be aligned top, center, baseline and bottom. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest from pyglet import gl from pyglet import font import base_text class TEST_VALIGN(base_text.TextTestBas...
Python
#!/usr/bin/env python '''Test that font colour is applied correctly. Default font should appear blue. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest import base_text from pyglet import font class TEST_COLOR(base_text.TextTestBase): def render(self): fnt = font.load(self.f...
Python
#!/usr/bin/env python '''Test that rendering of bullet glyphs works. You should see 5 bullet glyphs rendered in the bottom-left of the window. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest from pyglet import font import base_text class TEST_HALIGN(base_text.TextTestBase): font...
Python
#!/usr/bin/env python '''Base class for text tests. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest import sys from pyglet.gl import * from pyglet import font from pyglet.window import * from pyglet.window.event import * from tests.regression import ImageRegressionTestCase class Text...
Python
#!/usr/bin/env python '''Test that text will not wrap when its width is set to its calculated width. You should be able to clearly see "TEST TEST" on a single line (not two) and "SPAM SPAM SPAM" over two lines, not three. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest import base_text...
Python
#!/usr/bin/env python '''Test that a font with no name given still renders using some sort of default system font. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest import base_text class TEST_DEFAULT(base_text.TextTestBase): font_name = '' if __name__ == '__main__': unittest.ma...
Python
#!/usr/bin/env python '''Test that font colour is applied correctly. Default font should appear at 0.1 opacity (faint white) ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest import base_text from pyglet import font class TEST_COLOR_BLEND(base_text.TextTestBase): def render(self): ...
Python
#!/usr/bin/env python '''Test that a font likely to be installed on the computer can be loaded and displayed correctly. One window will open, it should show "Quickly brown fox" at 24pt using: * "Helvetica" on Mac OS X * "Arial" on Windows ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import un...
Python
#!/usr/bin/env python '''Test that font.Text alignment works with multiple lines. Three labels will be rendered at the top-left, center and bottom-right of the window. Resize the window to ensure the alignment is as specified. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest from pygl...
Python
#!/usr/bin/env python '''Test that a font with no name given still renders using some sort of default system font. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest import base_text class TEST_DEFAULT(base_text.TextTestBase): font_name = '' if __name__ == '__main__': unittest.ma...
Python
#!/usr/bin/env python '''Test that font.Text vertical alignment works. Four labels will be aligned top, center, baseline and bottom. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest from pyglet import gl from pyglet import font import base_text class TEST_VALIGN(base_text.TextTestBas...
Python
#!/usr/bin/env python '''Test that a specific DPI can be set to render the text with. Some text in Action Man font will be displayed. A green box should exactly bound the top and bottom of the text. Press ESC to end the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import os import unittest ...
Python
#!/usr/bin/env python '''Test that font colour is applied correctly. Default font should appear at 0.1 opacity (faint white) ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest import base_text from pyglet import font class TEST_COLOR_BLEND(base_text.TextTestBase): def render(self): ...
Python
#!/usr/bin/env python '''Test that font.Text horizontal alignment works. Three labels will be rendered aligned left, center and right. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest from pyglet import font import base_text class TEST_HALIGN(base_text.TextTestBase): font_name = ...
Python
#!/usr/bin/env python '''Test that a font distributed with the application can be displayed. Four lines of text should be displayed, each in a different variant (bold/italic/regular) of Action Man at 24pt. The Action Man fonts are included in the test directory (tests/font) as action_man*.ttf. Press ESC to end the ...
Python
#!/usr/bin/python '''Test that the event loop can do timing. The test will display a series of intervals, iterations and sleep times. It should then display an incrementing number up to 2x the number of iterations, at a rate determined by the interval. ''' import sys import unittest import pyglet __non...
Python
#!/usr/bin/python '''Test that the event loop can do timing. The test will display a series of intervals, iterations and sleep times. It should then display an incrementing number up to 2x the number of iterations, at a rate determined by the interval. ''' import sys import unittest import pyglet __non...
Python
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest from pyglet.image import get_buffer_manager class ImageRegressionTestCase(unittest.TestCase): _enable_regression_image = False _enable_interactive = True _captured_image = None def capture_regress...
Python
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest from pyglet.image import get_buffer_manager class ImageRegressionTestCase(unittest.TestCase): _enable_regression_image = False _enable_interactive = True _captured_image = None def capture_regress...
Python
#!/usr/bin/env python '''Test that audio playback works. You should hear a tone at 440Hz (A above middle C) for 1.0 seconds. The test will exit immediately after. You may want to turn down the volume of your speakers. ''' import unittest from pyglet import media from pyglet.media import procedural ...
Python
#!/usr/bin/env python '''Test that audio playback works. You should hear white noise (static) for 0.5 seconds. The test will exit immediately after. You may want to turn down the volume of your speakers. ''' import unittest from pyglet import media from pyglet.media import procedural class TEST_...
Python
#!/usr/bin/env python '''Test that audio playback works. You should hear white noise (static) for 0.5 seconds. The test will exit immediately after. You may want to turn down the volume of your speakers. ''' import unittest from pyglet import media from pyglet.media import procedural class TEST_...
Python
#!/usr/bin/env python '''Test that audio playback works. You should hear white noise (static) for 0.5 seconds. The test will exit immediately after. You may want to turn down the volume of your speakers. ''' import unittest from pyglet import media from pyglet.media import procedural class TEST_...
Python
#!/usr/bin/env python '''Test that audio playback works. You should hear white noise (static) for 0.5 seconds. The test will exit immediately after. You may want to turn down the volume of your speakers. ''' import unittest from pyglet import media from pyglet.media import procedural class TEST_...
Python
#!/usr/bin/env python '''Test that audio playback works. You should hear white noise (static) for 0.25 seconds, then a 0.5 second pause then another 0.25 seconds of noise. The test will exit immediately after. You may want to turn down the volume of your speakers. ''' import unittest import time ...
Python
#!/usr/bin/env python '''Test that audio playback works. You should hear white noise (static) for 0.5 seconds. The test will exit immediately after. You may want to turn down the volume of your speakers. ''' import unittest from pyglet import media from pyglet.media import procedural class TEST_...
Python
#!/usr/bin/env python '''Test that audio playback works. You should hear white noise (static) for 0.5 seconds. The test will exit immediately after. You may want to turn down the volume of your speakers. ''' import unittest from pyglet import media from pyglet.media import procedural class TEST_...
Python
#!/usr/bin/env python '''Test that audio playback works. You should hear a tone at 440Hz (A above middle C) for 1.0 seconds. The test will exit immediately after. You may want to turn down the volume of your speakers. ''' import unittest from pyglet import media from pyglet.media import procedural ...
Python
#!/usr/bin/env python '''Test that audio playback works. You should hear white noise (static) for 0.5 seconds. The test will exit immediately after. You may want to turn down the volume of your speakers. ''' import unittest from pyglet import media from pyglet.media import procedural class TEST_...
Python
#!/usr/bin/env python '''Test that audio playback works. You should hear white noise (static) for 0.5 seconds. The test will exit immediately after. You may want to turn down the volume of your speakers. ''' import unittest from pyglet import media from pyglet.media import procedural class TEST_...
Python
#!/usr/bin/env python '''Test that audio playback works. You should hear white noise (static) for 0.25 seconds, then a 0.5 second pause then another 0.25 seconds of noise. The test will exit immediately after. You may want to turn down the volume of your speakers. ''' import unittest import time ...
Python
#!/usr/bin/env python '''Test that window size can be set. Expected behaviour: One window will be opened. The window's dimensions will be printed to the terminal. - press "x" to increase the width - press "X" to decrease the width - press "y" to increase the height - press "Y" to decre...
Python
#!/usr/bin/env python '''Test that exclusive mouse mode can be set. Expected behaviour: One window will be opened. Press 'e' to enable exclusive mode and 'E' to disable exclusive mode. In exclusive mode: - the mouse cursor should be invisible - moving the mouse should generate events with bogu...
Python
#!/usr/bin/env python '''Test that window style can be dialog. Expected behaviour: One dialog-styled window will be opened. Close the window or press ESC to end the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Holkner $' import un...
Python
#!/usr/bin/python # $Id:$ import unittest from pyglet import window import base_event_sequence __noninteractive = True class TEST_CLASS(base_event_sequence.BaseEventSequence): last_sequence = 3 def on_resize(self, width, height): self.check_sequence(1, 'on_resize') def on_show(self): ...
Python
#!/usr/bin/env python '''Test that screens can be selected for fullscreen. Expected behaviour: One window will be created fullscreen on the primary screen. When you close this window, another will open on the next screen, and so on until all screens have been tested. Each screen will be filled ...
Python
#!/usr/bin/env python '''Test that minimum and maximum window size can be set. Expected behaviour: One window will be opened. The window's dimensions will be printed to the terminal. Initially the window has no minimum or maximum size (besides any OS-enforced limit). - press "n" to set the minimum...
Python
#!/usr/bin/env python # $Id: $ import unittest from pyglet import window import base_event_sequence __noninteractive = True class TEST_CLASS(base_event_sequence.BaseEventSequence): last_sequence = 2 def on_resize(self, width, height): self.check_sequence(1, 'on_resize') def on_expose(self): ...
Python
#!/usr/bin/env python '''Test that window icon can be set for multiple sizes. Expected behaviour: One window will be opened. The window's icon depends on the icon size: 16x16 icon is a yellow "1" 32x32 icon is a purple "2" 48x48 icon is a cyan "3" 72x72 icon is a red "4" 128x12...
Python
#!/usr/bin/env python # $Id: $ import unittest from pyglet import window import base_event_sequence __noninteractive = True class TEST_CLASS(base_event_sequence.BaseEventSequence): last_sequence = 3 def on_resize(self, width, height): self.check_sequence(1, 'on_resize') def on_show(self): ...
Python
#!/usr/bin/env python '''Test that mouse drag event works correctly. Expected behaviour: One window will be opened. Click and drag with the mouse and ensure that buttons, coordinates and modifiers are reported correctly. Events should be generated even when the drag leaves the window. Close the win...
Python
#!/usr/bin/env python '''Test that the window can be hidden and shown. Expected behaviour: One window will be opened. Every 5 seconds it will toggle between hidden and shown. Press escape or close the window to finish the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import time ...
Python
#!/usr/bin/env python '''Test that a window can be opened. Expected behaviour: One small window will be opened coloured purple. Close the window or press ESC to end the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest from pyglet import window from pyglet.gl import * clas...
Python
#!/usr/bin/env python '''Test that close event works correctly. Expected behaviour: One window will be opened. Click the close button and ensure the event is printed to the terminal. The window should not close when you do this. Press ESC to end the test. ''' __docformat__ = 'restructuredtext' __v...
Python
#!/usr/bin/env python '''Test that window expose event works correctly. Expected behaviour: One window will be opened. Uncovering the window from other windows or the edge of the screen should produce the expose event. Note that on OS X and other compositing window managers this event is equivalent ...
Python
#!/usr/bin/env python '''Test that window location can be set. Expected behaviour: One window will be opened. The window's location will be printed to the terminal. - Use the arrow keys to move the window. Close the window or press ESC to end the test. ''' __docformat__ = 'restructuredtext' __v...
Python
#!/usr/bin/env python '''Test that window style can be borderless. Expected behaviour: One borderless window will be opened. Mouse click in the window to close it and end the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Holkner $' ...
Python
#!/usr/bin/env python '''Test that mouse scroll event works correctly. Expected behaviour: One window will be opened. Move the scroll wheel and check that events are printed to console. Positive values are associated with scrolling up. Scrolling can also be side-to-side, for example with an Apple M...
Python
#!/usr/bin/env python # $Id: $ import unittest from pyglet import window import base_event_sequence __noninteractive = True class TEST_CLASS(base_event_sequence.BaseEventSequence): last_sequence = 3 def on_resize(self, width, height): self.check_sequence(1, 'on_resize') def on_show(self): ...
Python
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest from pyglet import window from pyglet.window.event import WindowEventLogger from pyglet.window import key from pyglet.gl import * import window_util class WINDOW_SET_FULLSCREEN(unittest.TestCase): def on_te...
Python
#!/usr/bin/env python '''Test that mouse button events work correctly. Expected behaviour: One window will be opened. Click within this window and check the console output for mouse events. - Buttons 1, 2, 4 correspond to left, middle, right, respectively. - No events for scroll wheel - Modi...
Python
#!/usr/bin/env python '''Test that window style can be borderless. Expected behaviour: One borderless window will be opened. Mouse click in the window to close it and end the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Holkner $' ...
Python
#!/usr/bin/env python '''Test that close event works correctly. Expected behaviour: One window will be opened. Click the close button and ensure the event is printed to the terminal. The window should not close when you do this. Press ESC to end the test. ''' __docformat__ = 'restructuredtext' __v...
Python
#!/usr/bin/env python '''Test that window can be resized. Expected behaviour: One window will be opened. It should be resizable by the user. Close the window or press ESC to end the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Ho...
Python
#!/usr/bin/env python '''Test that window icon can be set for multiple sizes. Expected behaviour: One window will be opened. The window's icon depends on the icon size: 16x16 icon is a yellow "1" 32x32 icon is a purple "2" 48x48 icon is a cyan "3" 72x72 icon is a red "4" 128x12...
Python
#!/usr/bin/env python '''Test that the window can be activated (focus set). Expected behaviour: One window will be opened. Every 5 seconds it will be activated; it should be come to the front and accept keyboard input (this will be shown on the terminal). On Windows XP, the taskbar icon may flash (i...
Python
#!/usr/bin/env python '''Test that a window can be opened fullscreen. Expected behaviour: A fullscreen window will be created, with a flat purple colour. - Press 'g' to leave fullscreen mode and create a window. - Press 'f' to re-enter fullscreen mode. - All events will be printed to the console. ...
Python
#!/usr/bin/env python '''Test that screens can be selected for fullscreen. Expected behaviour: One window will be created fullscreen on the primary screen. When you close this window, another will open on the next screen, and so on until all screens have been tested. Each screen will be filled ...
Python
#!/usr/bin/env python '''Test that a window can be opened. Expected behaviour: One small window will be opened coloured purple. Close the window or press ESC to end the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest from pyglet import window from pyglet.gl import * clas...
Python
#!/usr/bin/env python '''Test that image mouse cursor can be set. Expected behaviour: One window will be opened. The mouse cursor in the window will be a custom cursor. Close the window or press ESC to end the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest from pygl...
Python
#!/usr/bin/env python '''Test that window location can be set. Expected behaviour: One window will be opened. The window's location will be printed to the terminal. - Use the arrow keys to move the window. Close the window or press ESC to end the test. ''' __docformat__ = 'restructuredtext' __v...
Python
#!/usr/bin/python # $Id:$ from pyglet.gl import * def draw_client_border(window): glClearColor(0, 0, 0, 1) glClear(GL_COLOR_BUFFER_BIT) glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(0, window.width, 0, window.height, -1, 1) glMatrixMode(GL_MODELVIEW) glLoadIdentity()...
Python
#!/usr/bin/env python '''Test that vsync can be set. Expected behaviour: A window will alternate between red and green fill. - Press "v" to toggle vsync on/off. "Tearing" should only be visible when vsync is off (as indicated at the terminal). Not all video drivers support vsync. On Linux,...
Python
#!/usr/bin/env python '''Test that text events work correctly. Expected behaviour: One window will be opened. Type into this window and check the console output for text events. - Repeated when keys are held down - Motion events (e.g., arrow keys, HOME/END, etc) are reported - Select events ...
Python
#!/usr/bin/env python # $Id: $ import unittest from pyglet import window import base_event_sequence __noninteractive = True class TEST_CLASS(base_event_sequence.BaseEventSequence): last_sequence = 2 def on_resize(self, width, height): self.check_sequence(1, 'on_resize') def on_expose(self): ...
Python
#!/usr/bin/env python '''Test that exclusive keyboard mode can be set. Expected behaviour: One window will be opened. Press 'e' to enable exclusive mode and 'E' to disable exclusive mode. In exclusive mode: - Pressing system keys, the Expose keys, etc., should have no effect besides displayi...
Python
#!/usr/bin/env python '''Test that window style can be dialog. Expected behaviour: One dialog-styled window will be opened. Close the window or press ESC to end the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Holkner $' import un...
Python
#!/usr/bin/env python '''Test that resize event works correctly. Expected behaviour: One window will be opened. Resize the window and ensure that the dimensions printed to the terminal are correct. You should see a green border inside the window but no red. Close the window or press ESC to end the ...
Python
#!/usr/bin/env python '''Test that show and hide events work correctly. Expected behaviour: One window will be opened. There should be one shown event printed initially. Minimizing and restoring the window should produce hidden and shown events, respectively. On OS X the events should also be fired...
Python
#!/usr/bin/env python '''Test that mouse button events work correctly. Expected behaviour: One window will be opened. Click within this window and check the console output for mouse events. - Buttons 1, 2, 4 correspond to left, middle, right, respectively. - No events for scroll wheel - Modi...
Python
#!/usr/bin/env python '''Test that window icon can be set. Expected behaviour: One window will be opened. It will have an icon depicting a yellow "A". Close the window or press ESC to end the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:...
Python
#!/usr/bin/env python '''Test that multiple windows can be opened. Expected behaviour: Two small windows will be opened, one coloured yellow and the other purple. Close either window or press ESC to end the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest from pyglet...
Python
#!/usr/bin/env python '''Test that key press and release events work correctly. Expected behaviour: One window will be opened. Type into this window and check the console output for key press and release events. Check that the correct key symbol and modifiers are reported. Close the window or press...
Python
#!/usr/bin/env python '''Test that window move event works correctly. Expected behaviour: One window will be opened. Move the window and ensure that the location printed to the terminal is correct. Close the window or press ESC to end the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id:...
Python
#!/usr/bin/env python '''Test that a window can have multisample. A window will be opened containing two rotating squares. Initially, there will be no multisampling (the edges will look "jaggy"). Press: * M to toggle multisampling on/off * S to increase samples (2, 4, 6, 8, 10, ...) * Shift+S to...
Python
#!/usr/bin/env python '''Test that window style can be tool. Expected behaviour: One tool-styled window will be opened. Close the window to end the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Holkner $' import unittest from pygl...
Python
#!/usr/bin/env python # $Id: $ import unittest from pyglet import window import base_event_sequence __noninteractive = True class TEST_CLASS(base_event_sequence.BaseEventSequence): last_sequence = 2 def on_resize(self, width, height): self.check_sequence(1, 'on_resize') def on_expose(self): ...
Python
#!/usr/bin/env python '''Test that the window caption can be set. Expected behaviour: Two windows will be opened, one with the caption "Window caption 1" counting up every second; the other with a Unicode string including some non-ASCII characters. Press escape or close either window to finished the ...
Python
#!/usr/bin/env python '''Test that the window can be hidden and shown. Expected behaviour: One window will be opened. Every 5 seconds it will toggle between hidden and shown. Press escape or close the window to finish the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import time ...
Python
#!/usr/bin/env python '''Test that mouse scroll event works correctly. Expected behaviour: One window will be opened. Move the scroll wheel and check that events are printed to console. Positive values are associated with scrolling up. Scrolling can also be side-to-side, for example with an Apple M...
Python
#!/usr/bin/env python '''Test that minimum and maximum window size can be set. Expected behaviour: One window will be opened. The window's dimensions will be printed to the terminal. Initially the window has no minimum or maximum size (besides any OS-enforced limit). - press "n" to set the minimum...
Python
#!/usr/bin/env python '''Test that mouse enter and leave events work correctly. Expected behaviour: One window will be opened. Move the mouse in and out of this window and ensure the events displayed are correct. Close the window or press ESC to end the test. ''' __docformat__ = 'restructuredtext' __ve...
Python