Let's continue the plugin tutorial. The last installement was on how plugins work and how to create the boilerplate for a new plugin. Now let's look into how to access Liferea UI elements and how to modify them.
Accessing UI elements
Using the plugin boilerplate for a Liferea.ShellActivatable (a plugin that activates once the Liferea shell, which as an object comprises the entire main window UI, has been setup) we get a member variable named "shell"
shell = GObject.property (type=Liferea.Shell)
which can be used to look up GTK objects by name using
Some interesting names to look up are:
The main GtkWindow
The vertical pane containing the feed list
The vertical pane containing the rest
The feed list GtkTreeView
The item list GtkTreeView
The tabs notebook of the item view
The main window status bar
This list not being exhaustive you can grep the code for more uses
rgrep liferea_shell_lookup src/
in general when you want to modify existing UI elements or add extra elements to the UI above list should be a good start.
Example: Modifying the feed list
Here is a simple example to hide the 2nd column of the feed list GtkTreeView. To do this we use the "shell" member to look up the "feedlist" GtkTreeView and ask it for the 2nd column which we then hide: