User Tools

Site Tools


k12:k12.1:k12.1.2:start

12.1.2 Form - Methods

This chapter introduces you to important methods of the Form (gb.qt4) class.

MethodDescription
Activate( )Activates a window (→ http://gambaswiki.org/wiki/doc/window-activate).
Center( )Centers a window on the screen.
Close( [ Return As Integer ] ) As BooleanCloses the window. An integer value can be passed to the function as an optional argument. If the window is not persistent (Window.Persistent = False (default)), the window is destroyed after the Close() method is called. This means that all objects and variables of the window are also destroyed and lose their values.
Delete( )Deletes the window.
Hide( )Hides the window.
Raise( )Brings a (hidden) window to the foreground.
Move ( X As Integer, Y As Integer [ , Width As Integer, Height As Integer ] )Moves the window to the position (X|Y) and also changes the window size if the two optional arguments Width and Height are specified. Attention: Resizing is affected by the value of the property Window.Utility.
MoveScaled ( X As Float, Y As Float [ , Width As Float, Height As Float ] )Moves the window (upper left corner) to the position (X|Y) and also changes the window size if the two optional arguments Width and Height are specified. The specified values are each multiplied by the value of Desktop.Scale (→ Chapter 15.6 Class Desktop (gb.qt4) ).
Refresh( )Redraws the window. However, the redrawing is not processed until the next call of the event loop. If you need an immediate refresh of the window, call WAIT after using the Refresh() method.
ResizeScaled ( Width As Float, Height As Float )Changes the window size. The specified coordinates are each multiplied by the value of Desktop.Scale.
SetFocus( )Sets the focus on the window.
Show( )Displays the window in non-modal mode. If a modal window is already displayed, the window is still displayed in modal mode.
ShowModal( ) As IntegerDisplays the window in modal mode. This method ends only when the window is closed. The value passed to the Close() method is returned.
ShowPopup( [ X As Integer, Y As Integer ] ) As IntegerSets the window as a (borderless) popup window. If the optional coordinates are specified, the pop-up window is displayed at the position (X|Y) (→ left, upper pop-up window corner). Otherwise the pop-up window is displayed under the mouse pointer.

Table 12.1.2.1 : Methods of the class Form

The website uses a temporary session cookie. This technically necessary cookie is deleted when the browser is closed. You can find information on cookies in our privacy policy.
k12/k12.1/k12.1.2/start.txt · Last modified: 01.02.2022 (external edit)

Page Tools