GTK 2

(last updated: 2003-10-18.)

GTK 2

GTK+ 2.0 came out recently, and it is full of changes. Here are some of my notes towards making it more usable. See also: my GTK software and my page on X input (for inputting Japanese).

This page used to contain more, but I have removed tips and tricks as they have been obsoleted by improvements in GTK.

Keybindings

The default GTK2 keybindings are supposed to be more user-friendly (Ctl+A maps to "select all") but this user likes Emacs keybindings (though I prefer VIM). Add this to your ~/.gtkrc-2.0:

gtk-key-theme-name = "Emacs"

Colin Marquardt (<c.marquardt@alcatel.de>) submitted this tip: by adding

gtk-can-change-accels = 1

you can change the keybindings in menus by hitting the hotkey you want to map the menu to while the mouse is over the menu item. (Note that if you're using GNOME, you'll need to change this using gconf-editor; the relevant key is /desktop/gnome/interface/can_change_accels.)

Style Properties

GTK2 supports options settable in the RC file called "style properties". It appears these are not documented anywhere. You can run this on a GTK source tree to find a list:

grep -A 6 install_style_property *.c | less

To change one, follow the style I used here (also in my ~/.gtkrc-2.0):

style "scrollbar" {
  GtkScrollbar::has_backward_stepper = 0
  GtkScrollbar::has_secondary_backward_stepper = 1
  GtkScrollbar::min_slider_length = 30
}
class "GtkScrollbar" style "scrollbar"

Cursor

Another style property lets you modify the cursor. Richard Kimber (<rkimber@ntlworld.com>) sent in:

...in bluefish I needed to make the cursor more visible. This was achieved by

Other Notes

Please mail me if you know anything that belongs on this page.

Evan Martin, martine@danga.com