Experimental GUI

To test run with:

ipython --gui=tk -i -m oberon.IDE -- -n

Let’s break that down. We’re using ipython. The --gui=tk CLI option tells it to use the Tkinter-compatible event loop, -i tells it to drop into interactive mode after the script ends rather than exiting, -m oberon.IDE tells it to use the oberon.IDE.__main__ module as the script to run, and -- tells it to pass the rest of the CLI options to the script itself. The -n CLI option is detected by the main script and prevents it from starting the Tkinter mainloop on its own.

The combination of using IPython’s Tkinter-compatible event loop and not calling the Tkinter mainloop in the main script lets you use IPython shell while the GUI runs and updates. This is really flexible and powerful, as you have all of Python available to work with, but you have to read the source and know something about Python and Tkinter GUI code to take advantage of it.

For example, the main script creates the app and puts it in a variable w, and you can change the font properties like this:

In [1]: w.font['family'] = 'Iosevka Term'

In [2]: w.font['size'] = 12
class oberon.IDE.widgets.Breakpoints(root, font)[source]
class oberon.IDE.widgets.DebugApp(cpu=None)[source]

damn

class oberon.IDE.widgets.FlagWidget(root, label_text, font)[source]

Display a binary Boolean flag.

value = None

Call the set method of this IntVar with 0 or 1.

class oberon.IDE.widgets.LabelText(root, label, font, **kw)[source]
class oberon.IDE.widgets.PickleJar(app, font, save_dir=None)[source]

Manage the directory of saved states.

class oberon.IDE.widgets.RAMInspector(root, font)[source]
update(cpu, syms)[source]

Enter event loop until all pending events have been processed by Tcl.

class oberon.IDE.widgets.RegisterWidget(root, label_text, font)[source]

Display one register.

FORMATS = ['%08x', <function RegisterWidget.<lambda>>, <function RegisterWidget.<lambda>>, '%i', <function RegisterWidget.<lambda>>, <function RegisterWidget.<lambda>>]

A list of format strings or callables that are used to convert register values to strings for display.

current_format = None

Index into the ring buffer of format strings for register label.

label = None

Display the register value.

set(value)[source]

Given an integer value set the string value of the label.

toggle_format(event=None)[source]

Switch to the next formatter.

value = None

The current text to display.

class oberon.IDE.widgets.ScrollingListbox(root, font, **kw)[source]
class oberon.IDE.widgets.Watch(root, font)[source]
update(cpu, syms)[source]

Enter event loop until all pending events have been processed by Tcl.