Focus Handling

Introduction
The focus signal
The Beginning
The Sequel
The Final

This chapter describes the implementation of focus handling in the canvas, which is used for the criawips presentation application.

Introduction

The focus is a meta-information, which is correctly called 'the focused item'. The focused item is the one which receives keyboard events. The focus can be moved by using the keys up, down, left, right, tab and shift-tab (usually also available with ctrl if the keys are used for other things - like text editing).

The focus is view-dependent, there may even be views (like the tree or pixbuf renderers) which don't have a focus at all. This make the focus implementation slightly harder than GnomeCanvas' focus handling has been.

The focus list (which is the list starting with the focused item and then mentioning all its parents up to the root of the view - which might not always be the root of the model) is very important as we need to know which items already were focused and which were not. As we cannot store the focused elements in the model - which was possible with the GnomeCanvas - we need to store it in the view. So the view needs to take care about the focus list.