It seems to me that a possible solution would be to connect to the 'page-reordered' signal as follows:
import gtk def on_reorder(notebook, child, number, user_data): if number == 0: notebook.reorder_child(user_data, 0) def main(): mainwin = gtk.Window() notebook = gtk.Notebook() mainwin.add(notebook) mainwin.set_default_size(200,200) for label in ['Search', 'Row#6', 'Row#9']: child = gtk.VBox() notebook.append_page(child, gtk.Label(label)) if label != 'Search': notebook.set_tab_reorderable(child, True) else: notebook.set_tab_reorderable(child, False) searchtab = notebook.get_nth_page(0) notebook.connect('page-reordered', on_reorder, searchtab) mainwin.show_all() mainwin.connect('destroy', gtk.main_quit) gtk.main() if __name__ == "__main__": main()
Hope this helps.
source share