wx.lib.agw.persist

Hi Andrea,

The following would be useful to allow just to RestoreAll along the lines of RegisterAndRestoreAll.

     def RestoreAll(self, window, children=None):
         """
         Recursively restore the state of the input `window` and of
         all of its children.

         :param `window`: an instance of :class:`Window`;
         :param `children`: list of children of the input `window`, on first call it is equal to ``None``.
         """

         if children is None:
             if HasCtrlHandler(window):
                 # Control has persist support
                 self._hasRestored = self.Restore(window)

             children = window.GetChildren()

         for child in children:
             name = child.GetName()

             if name not in BAD_DEFAULT_NAMES:
                 if HasCtrlHandler(child):
                     # Control has persist support
                     self._hasRestored = self.Restore(child)

             self.RestoreAll(window, child.GetChildren())

         return self._hasRestored

What do you think?

Werner

Hi Werner,

Hi Andrea,

The following would be useful to allow just to RestoreAll along the lines of
RegisterAndRestoreAll.

    def RestoreAll(self, window, children=None):
        """
        Recursively restore the state of the input `window` and of
        all of its children.

        :param `window`: an instance of :class:`Window`;
        :param `children`: list of children of the input `window`, on first
call it is equal to ``None``.
        """

        if children is None:
            if HasCtrlHandler(window):
                # Control has persist support
                self._hasRestored = self.Restore(window)

            children = window.GetChildren()

        for child in children:
            name = child.GetName()

            if name not in BAD_DEFAULT_NAMES:
                if HasCtrlHandler(child):
                    # Control has persist support
                    self._hasRestored = self.Restore(child)

            self.RestoreAll(window, child.GetChildren())

        return self._hasRestored

What do you think?

Good idea, I have added it to `persistencemanager.py` for both Classic
and Phoenix.

Thank you!

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."

# ------------------------------------------------------------- #
def ask_mailing_list_support(email):

    if mention_platform_and_version() and include_sample_app():
        send_message(email)
    else:
        install_malware()
        erase_hard_drives()
# ------------------------------------------------------------- #

···

On 19 March 2013 14:26, Werner wrote:

Hi Andrea,

...

Good idea, I have added it to `persistencemanager.py` for both Classic
and Phoenix.

Great, thanks
Werner

···

On 27/03/2013 22:16, Andrea Gavana wrote: