enthought / enthought/pyface

Add an IContainer Interface

Open
#738 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
115
Forks
54
PR merge metrics
No merged PRs in 30d

Description

There is already an informal interface used in a number of places where a `Widget` which contains other widgets, such as `IDialog`, `IApplicationWindow`, and possibly others, expect subclasses to override the `_create_contents` method to populate and layout the main area of the control. These widgets may have additional contents beyond these things (eg. a dialog's buttons), so this method provides a hook for customization.

The interface would look something like:
```
class IContainer(IWidget):
def _create_contents(self, parent):
pass
```
where `parent` is the parent widget for the contents (usually, but not always, `self.control`) and the method is expected to return a toolkit object.

Such an interface would be useful for a hypothetical `IPanel` (a possibly named/framed group within a larger UI).

By formalizing this interface, new classes would be more likely to follow it.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.