GraphicsWindow Class Reference« | ReferenceGuide | GraphicsCanvas » This class defines a basic top level window that can be opened on the desktop and used to produce simple graphical drawings. It contains a canvas on which geometric shapes can be drawn and manipulated. Public Methods
Detailed DescriptionGraphicsWindow()
Creates a new graphics window with a canvas that has a default size. The canvas contained in the window is initially empty with a white background. It is created with a default size of 400 x 400.
GraphicsWindow(width, height)
Creates a new graphics window with a canvas of the given size. The canvas contained in the window is initially empty with a white background. The size of the canvas will be set to the size specified by
width and height .
canvas()
Returns a reference to the canvas contained within the window. The canvas can be used to draw and manipulate geometric shapes and text.
wait()
Starts the event loop that processes various window events. This causes the sequential execution of the program to stop and wait for the user to click the close button on the main window or to call the quit() method on any window. This method should only be called on the main window.
setTitle(title)
Sets the title of the window. The title is displayed in the title bar of the top-level window. By default, the window has no title.
isValid()
Returns a Boolean indicating whether the window associated with the object exist and is valid. The object of an invalid window, which normally results from being closed, can not be used.
quit()
Terminates the event loop. When the event loop terminates, the program will continue execution at the point immediately after the call to the wait method.
close()
Closes and destroys the window. The object still exist, but the window is not valid and can not be used.
hide()
Hides or iconifies the top level window. The window still exists and can be displayed again using the show() method.
show()
Shows or deiconifies a previously hidden top level window.
|
||
Last modified: October 12, 2014, at 08:01 PM.
|