Release: 16/10/2001
Creating windows that reside within another window should ideally be a straightforward process. Unfortunately, windows cannot be arbitrarily embedded within other windows as they need to be specially created with this in mind. However, this isn't too much of a problem as it only requires that such a window be informed of the possibility of such a fate and the actual window into which it is embedded can be left until later.
The nested.py program demonstrates the placing of a window inside another. The important part is as follows:
# Create two windows
# The main window
window1 = app.Window(0, 0, 512, 512, 256, 256, 'ctThva', 0, None)
window1.set_title('1')
app.add_window(window1, 'window1')
# A window contained within the first window window2 = app.Window(0, 440, 1024, 72, 512, 72, 'h', 1, 'window1')
Note that the following will also work:
window2 = app.Window(0, 440, 1024, 72, 512, 72, 'h', 1, 'badger')
window1.add_object(window2, 'window2', 0) window1.centred()