From: Hiroo H. <hir...@co...> - 2005-01-12 04:46:40
|
Rib, Yes, you are right. After I sent my mail, I read your code for a while, and found the JSLDesktop.JSLFakeDesktop.last_selected field. I added the following code for each class which creates JSLFrame. (This is the easy fix I wrote, yesterday.) public void JSLFrameDeactivated(JSLFrameEvent e) { + Actions.setEnabled(false, Actions.EN_ALL); } But this does not fix every case. I think the problem is the 'last_selected' field is not set to 'null', when it deactivated or closed(). The latter is worse than the former. It will pointed destroyed JSLFrame object. I guess this is the situation Eelco reported. If I understand your code correctly, 'last_selected' must be handled as follows; set the current JSLFrame when it is deactivated. set null when a JSLFrame is activated. set null when a JSLFrame is deiconified or closed. If deiconified or closed event can occur after deactivated method the 1st condition will be; set the current JSLFrame when it is deactivated and (not deiconified or closed). Am I correct? BTW could you add some comments on your JSL* classes? Now they have almost no comments. It was difficult for me to understand. And you (we) are thinking to move them into a independent package to be shared with other application. They needs some Java comments to be reused. And they has some code depending for JSynthLib, AppConfig.getGuiStyle(), PatchEdit.exit(), etc. Some hooks will be defined to support them from outside of the package. Rib> In SDI mode, I think it remembers the last window that was focused Rib> when the toolbar is activated and returns that as the selected frame. Rib> If not, that's what I intended it to do. =2E.. Rib> > Eelco> in core.Actions in the method saveFrame() a NPE is thrown Rib> > Eelco> when the library frame is not selected. In the following snip= pet: Rib> >=20 Rib> > I see the problem. The current code does not care the case when no Rib> > frame is selected. Many other command should have same problem. At = that Rib> > time most of commands must be disabled. Rib> >=20 Rib> > Well, but when Tool Bar windows is used in SDI mode (multi frame mod= e), Rib> > no library/editor window is selected. An easy fix will make the Too= l Rib> > Bar window useless. I need to think more... --=20 Hiroo Hayashi |