def test_serialize(self): win = gtk.Window(gtk.WINDOW_TOPLEVEL) layout = DockLayout() frame = DockFrame() win.add(frame) layout.add(frame) paned = DockPaned() frame.add(paned) group = DockGroup() paned.add(group) item = DockItem(title='t', title_tooltip_text='xx', icon_name='icon', stock_id="") item.set_name('fillme') group.add(item) s = serialize(layout) assert '<layout><dockframe height="1" width="1">'\ '<dockpaned orientation="horizontal">'\ '<dockgroup weight="100">'\ '<dockitem icon_name="icon" title="t" tooltip="xx" />'\ '</dockgroup></dockpaned></dockframe></layout>' == s, s
def _on_save_button_clicked(self, button): file = "demo.sav" s = dockstore.serialize(self.docklayout) with open(file, "w") as f: f.write(s)