The examples linked show how to write panel applets, which have been somewhat discouraged for a while now. Instead, you probably want to create a gtk.StatusIcon. Status icons require the user to have a system tray, but given their widespread use that covers just about everyone.
Once you've got your status icon, minimizing to the panel is a simple matter of:
- showing/hiding your application window when the icon is clicked, probably in the StatusIcon's
activate
signal handler; and
- listen to
window-state-event
on your window, intercepting iconify changes so that you can hide your window instead of it being shown in the taskbar
Of course, using a status icon like this isn't really recommended from a UI point of view, but it is the most pragmatic solution currently.