Re: [Java-gnome-developer] Possible error in LibGlade.java
Brought to you by:
afcowie
From: Andrew C. <an...@op...> - 2005-03-12 01:35:13
|
On Fri, 2005-11-03 at 12:16 -0600, Clint Allen wrote: > I've got some singleton classes which extend LibGlade. The only insight on the specific crash you're encountering is that most people tend to use the LibGlade constructor with "this" to specify where the signals are going and what not [though, I've come to realize that it's generally more powerful (though not as easy) to use java-gnome listener/event pairs]. Maybe passing your "InputEditLogic" instance is the problem. For what it's worth, I've been addressing this sort of issue by a) naming my classes as WhateverWindow, and b) having the libglade call just be a part of the constructor for WhateverWindow, and saving the returned object in an instance variable. eg: private LibGlade _glade = null; WhateverWindow() { try { _glade = new LibGlade("share/whatever.glade", this); ... <shrug> Works for me; an instance field seems an appropriate place for it, and it saves having to code up the singleton pattern. AfC -- Andrew Frederick Cowie http://www.operationaldynamics.com/ Sydney New York Toronto London |