#!/usr/bin/env python
#
#  Copyright (C) 2005, 2006 Christian Persch
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2, or (at your option)
#  any later version.
#
import gtk
import epiphany
def apply_close_button(unbound, window, tab):
    hbox = window.get_notebook().get_tab_label(tab)
    button = hbox.get_children()[1]
    unbound(button)
def attach_tab (window, tab):
    apply_close_button(gtk.Button.hide, window, tab)
def detach_tab(window,tab):
    apply_close_button(gtk.Button.show, window, tab)