Am 03.03.2013 um 03:46 schrieb Kip Shaffer:

> Anybody using GladeVCP with Persistence?  Did you have trouble getting
> it to save settings?
> 
> It seems to me as though it is very sensitive to what widget the
> 'on_destroy' signal is attached.
> 
> The documentation does warn against attaching it to the 'window1'
> object.  But I had terrible luck getting it to save_state when
> LinuxCNC was shutting down.

me too, and I wrote that code ;)

unfortunately there is more than one way to shut down a gladevcp application:

- you can kill the window which will get you a destroy event
- the linuxcnc script however sends a signal to all running parties

to catch the second scenario, see 
http://www.linuxcnc.org/docs/devel/html/gui/gladevcp.html#_saving_state_when_ctrl_c_is_pressed


> 
> I was able to figure out what it was trying to do by putting print
> statements into
> /usr/lib/pymodules/python2.6/gladevcp/persistence.py
> 
> What I found was that the getter() returned by get_value() would fail
> when the window was being destroyed.

yes, it's a chicken-and-egg problem - persistence.py cant do anything anymore 
if it is called too late in the shutdown process (eg if the widgets are already 
destroyed there's no way to retrieve their state anymore)

let me know how it goes

- Michael
> 
> I resolved the problem by putting the 'on_destroy' signal on the same
> widget that was being read first.  There is no way to determine which
> widget will be first, other than by putting in print statements.
> 
> Has anyone else seen this behavior?
> 
> -Kip
> 
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> Emc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/emc-users


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to