Sunday 15 February 2009

Adding Code Intelligence to Komodo

Writing programs in Python using PyGTK can be hard as the documentation is not consistent and somewhat outdated.

Adding Code Intelligence to the Komodo IDE is a matter of adding a specific XML-File to the IDE. Here is the link to the CIX-Files that do the trick:
http://community.activestate.com/files/gtk._gtk.cix_.gz
http://community.activestate.com/files/gtk_v2.cix_.gz
Extract the files to a directory. Add the two under Edit/Preferences/CodeIntelligence "Add an API Catalog...".

Viola. You have code completion.

Monday 9 February 2009

Ubuntu Theme takes shape

As I struggle my way through the configuration files, GTK+ documentation and some source code, the Ubuntu Theme takes on shape.

I still have not found out how to distinguish between windows in the front (focused for Metacity) and the ones in the background (normal). Having a way to differentiate would allow for different coloring of widgets. This in turn would make for nice visual feedback.

Another issue I have to tackle with is figuring out the names of widgets in different applications. Not all of them are documented in the GTK documentation.

Finally my icons in the top panel grew all of a sudden from nice 28 px to 32px filling the whole panel. I have no clue what I did (acutally I think I did nothing, but that certainly is not the case). I would like to think this is due to errors in all the other themes.

Ideas anybody?

Sunday 8 February 2009

Awn Window Navigator

I follow development of the awn window navigator closely ever since it was first announced on Launchpad.




Awn window navigator is an Apple dock mimic. Under Gnome it acts a a panel on steriods. It lets you collect your favorite apps in a dock, supports drag-and-drop and gives nice visual feedback about the state of the application - Apple like.

Is it pretty? Yes,

Is it usefull? I'm not quite sure any more.

A shortcut collection of items makes sense if:
  • the set of common applications remains static most of the time
  • the set of apps is limited to a few (10 - 15 apps). Otherwise the dock will be overloaded and at the most exceed screen limits
  • the main screen is big enough for the extra space used by the dock
  • applications are hidden behind a cumbersome access path (like menues on Windows or folders on Macs)
Technically speaking, awn is working fine. It allows for customization, adding applications is straightforward, the tool is sufficiently responsive and graphically appealing.

So why do I doubt the usefullness of it?

Basically Ubuntu comes with some shortcuts in the main panel. This dock-like panel can be populated with additional apps. It does not provide visual feedback like awn. On the other hand, it does not use extra screen space (the dock is there anyway).

Ubuntu is reduced to some essential applications. The main menu is organized in logical compartments and can be adjusted to personal preferences using the menu editor. All of this makes Ubuntu easy to use and navigate.

It is because of the combination of just providing the essential applications and the option to add ones favorite applications as shortcuts to the top panel that makes awn redundant on Ubuntu (at least in my eyes).

My recommendation: If you want to mimic Apple, use awn. If you want to work, use the panel instead.

Thursday 5 February 2009

Trouble with gtkrc

Creating a Metacity window decoration was pretty straightforward. I have what I want. A smooth gray window title that dims when the window looses focus. When focused, it has a gradient look imitating a round vertical curve.

Here comes the catch.

Items in the window are controled by a file ~/.themes/mytheme/gtk-2.0/gtkrc. This file controls everything drawn inside the window -- buttons, menus, scrollbars - you name it.

Here is a basic gtkrc file:

###############################################################################
# default color scheme
###############################################################################
gtk_color_scheme = "fg_color:#202020\nbg_color:#D7D7D7\nbase_color:#FFFFFF\ntext_color:#202020\nselected_bg_color:#696986\nselected_fg_color:#FFFFFF\ntooltip_bg_color:#FCF6DE\ntooltip_fg_color:#202020\n"

###############################################################################
# default style
###############################################################################
style "default"
{
##################
# Color assignment
##################

fg[NORMAL] = @fg_color # Metacity and mouseover, Most text
fg[PRELIGHT] = @fg_color # Text when mouseover
fg[ACTIVE] = @fg_color # Text when mouseclicking button, Tabs, Active window list
fg[SELECTED] = @selected_fg_color # Metacity X when window selected
fg[INSENSITIVE] = darker(@bg_color) # Insensitive Text (in menus)

bg[NORMAL] = @bg_color # Normal Background, inactive Metacity bar, buttons
bg[PRELIGHT] = @bg_color # Mouseover buttons
bg[ACTIVE] = @bg_color # Mouseclicking, Tabs, active window list
bg[SELECTED] = @selected_bg_color # Metacity Bar
bg[INSENSITIVE] = @bg_color # Insensitive buttons

base[NORMAL] = @base_color # Background, most
base[PRELIGHT] = @base_color # Mouseover menu
base[ACTIVE] = @selected_bg_color # Menu active item in inactive window
base[SELECTED] = @selected_bg_color # Menu active item in active window
base[INSENSITIVE] = @bg_color # Background, insensitive

text[NORMAL] = @text_color # Text in window
text[PRELIGHT] = @text_color # Text on Mouseover
text[ACTIVE] = @selected_fg_color # Active text in inactive window
text[SELECTED] = @selected_fg_color # Active text in active window
text[INSENSITIVE] = @bg_color # Insensitive text

xthickness = 3
ythickness = 3

}
class "GtkWidget" style "default"

style "window" = "default"
{
bg[NORMAL] = shade(0.87,@bg_color)
}
class "GtkWindow" style "window"

style "menubar" = "default"
{
GtkMenuBar :: shadow-type = GTK_SHADOW_NONE
GtkToolbar :: shadow-type = GTK_SHADOW_NONE
bg[NORMAL] = shade(0.87,@bg_color)
}
class "GtkMenuBar" style "menubar"
class "GtkToolbar" style "menubar"

style "tooltip"
{
fg[NORMAL] = @tooltip_fg_color # required in order to set the gnome default colors right
bg[NORMAL] = @tooltip_bg_color
}
widget "gtk-tooltip*" style "tooltip"
Two problems with it:

1. It does not load when selected by the Appearance System panel.
2. (and this currently worries me more) I cannot lighten the window background when the window looses its focus.

I would like to change the color of the window interior when the window is in the background. This would allow for the window to visually vanish in the background.

Any hints?