DebugTab module

Contains ‘tabs’ which are really just frames but are used by the ttk.Notebook object for tabbed display.

The LogTab contains a Listbox and a Scrollbar. Strings can be sent to LogTab to be logged - they will be added to the list. When clicked, they display on a lower label to account for long-stringed log events.

The DebugTab contains buttons for adding objects, for testing purposes. The panels for adding those objects are part of this module.

class DebugTab.DebugTab(parent, window)[source]

Bases: tkinter.ttk.Frame

Fills a frame with some UI components for doing debug operations.

Created by Ui.MainWindow.

Parameters

parent (widget) – The frame where this component will be placed.

class DebugTab.ForceObjectAdder(window, parent_frame)[source]

Bases: object

Created by DebugTab.DebugTab.

May be removed in a future version. Somewhat redundant due to AddObjectWindow being implemented. However, it still does the binding of key presses to object moves, so it’s left for now while said feature is still useful for debug and testing.

add_button_press()[source]

Adds a cork object with mass 100,000 to the PhysicsCanvas

The object is controllable with keyboard inputs.

Returns

add_test_collision()[source]
key_handler(event)[source]
particle_test()[source]
class DebugTab.LogTab(parent, window)[source]

Bases: tkinter.ttk.Frame

Fills a frame with UI component necessary for keeping a log. Intended use is as a tab for the Notebook object.

Created by Ui.MainWindow

Uses a Tkinter.Listbox.

Parameters
  • parent (widget) – The frame where this component will be placed.

  • window (See MainWindow in :doc: Ui) – The broad reference window.

click(event)[source]

Called when ListBox in this widget is clicked.

Displays selected item in the label, in case the log entry is too long for the ListBox.

Parameters

event – MouseEvent

log(string)[source]

Creates an entry in the Listbox from the string. Prepends a timestamp. :param string: text to log