How to refresh a notebook on the fly?
I have an application which is supposed to have various number of pages according to the data in the underlying model. In order to synchronize the appearance of the Notebook I'd like to refresh it every time a row is added/deleted from the model.
I've tried this:
...
def get_pagebox(self, label)
...
return pagebox
def _reinit(self):
for child in self.notebook.get_children():
self.notebook.remove(child)
for label in self.get_labels():
self.notebook.append(self.get_pagebox(label), label)
self.notebook.queue_draw_area(0,0,-1,-1)
...
It removes the old pages, but fails to append new ones. What could be the problem and how do you think this could be done?