11.3. Working with titles

When you create a CList widget, you will also get a set of title buttons automatically. They live in the top of the CList window, and can act either as normal buttons that respond to being pressed, or they can be passive, in which case they are nothing more than a title. There are four different methods that aid us in setting the status of the title buttons.
 
clist.column_title_active(column)

clist.column_title_passive(column)

clist.column_titles_active()

clist.column_titles_passive()

An active title is one which acts as a normal button, a passive one is just a label. The first two calls above will activate/deactivate the title button above the specific column, while the last two calls activate/deactivate all title buttons in the supplied clist widget.

But of course there are those cases when we don't want them at all, and so they can be hidden and shown at will using the following two methods.
 
clist.column_titles_show()

clist.column_titles_hide()

For titles to be really useful we need a mechanism to set and change them, and this is done using
 
clist.set_column_title(column, title)

Note that only the title of one column can be set at a time, so if all the titles are known from the beginning, then I really suggest setting the titles when creating the clist. It saves you coding time, and makes your program smaller. There are some cases where getting the job done the manual way is better, and that's when not all titles will be text. CList provides us with title buttons that can in fact incorporate whole widgets, for example a pixmap. It's all done through
 
clist.set_column_widget(column, widget)

which should require no special explanation.