Skip to content
Adam Furman edited this page Jul 9, 2016 · 1 revision

GUI class

The GUI class sets up Pygame and the screen, and also acts as a container for all UI-related subclasses. It is automatically initialized by the system at start. It is accessible through state.

GUI ()

Accessible via state.getGUI().

Static Methods

  • getCenteredCoordinates ( component, larger ) Returns a set of coordinates that would place the Component component at the center of larger.

Object Variables

  • int orientation Not used yet.
  • pygame.clock.Clock timer The clock object that regulates loop speed.
  • int update_interval The current FPS.
  • int width The screen width.
  • int height The screen height. The height available to your app is this - the FunctionBar height.

Methods

  • orient ( int orientation ) Not working. Do not use.
  • repaint () Fills the screen with the background color.
  • refresh () Calls pygame.display.flip().
  • getScreen () Returns the global screen object.
  • monitorFPS () The system FPS monitoring function. Adjusts FPS for best performance.
  • displayStandbyText ( text="Stand by...", size=20, color=(20,20,20), bgcolor=(100,100,200) ) Displays the given text in a rectangle on the screen. Intended as a warning that an app is doing long work on the main thread.

Home

Getting Started

Documentation

Threads and Tasks

Applications and Notifications

The State Class and Variable

The GUI, Events, Resources, and Dialogs

The following classes are all under the GUI class, e.g. Font is actually accessed as GUI.Font.

  • Font class
  • Icons class
  • ColorPalette class
  • LongClickEvent class
  • IntermediateUpdateEvent class
  • EventQueue class
  • FunctionBar class
  • Keyboard class
  • Overlay class
  • Dialog class
    • OKDialog dialog
    • ErrorDialog dialog
    • WarningDialog dialog
    • YNDialog dialog
    • OKCancelDialog dialog
    • AskDialog dialog
    • CustomContentDialog dialog
  • NotificationMenu overlay
    • RecentAppSwitcher overlay
    • Selector overlay

GUI Components and Containers

  • Component class

The following classes are all Components, they inherit from that class.

  • Container component
  • AppContainer container
  • Button container
  • KeyboardButton container
  • TextEntryField container
  • PagedContainer container
    • GriddedPagedContainer container
    • ListedPagedContainer container
  • ButtonRow container
  • ScrollableContainer container
    • ListScrollableContainer container
    • TextScrollableContainer container
    • MultiLineTextEntryField container
  • Text component
  • MultiLineText component
  • ExpandingMultiLineText component
  • Image component
  • Slider component
  • Checkbox component
  • Switch component
  • Canvas component
  • ScrollIndicator component
Clone this wiki locally