Hi all,
After 10+ hours of frustration its time to swallow my pride and ask somebody...
I'm constructing what I imagine is a fairly simple interface in 2.4.2.4u, with a MainFrame carrying a single SplitterWindow. The left side (pane_1) will house some control elements in a notebook, while the right side (pane_2) will display the "working" Panel.
I've implemented a method (Swap) in MainFrame to call SplitterWindow.ReplaceWindow whenever required (the method also allows me to SetMenuBar, SetToolBar, and Pop-and-PushEventHandler at the frame level at the same time).
def Swap(self, package='package', pmod='module', pclass='class', menubar='menubar', toolbar='toolbar', events='events'):
global PANEL
if pclass != 'class':
PANEL['class'] = pclass
exec 'import ' + PANEL['package'] + "." + PANEL['module']
self.newpanel = eval(PANEL['package'] + "." + PANEL['module'] + "." + PANEL['class'])
window_1.ReplaceWindow(pane_2, self.newpanel(window_1, -1))
I'm currently bringing in a very slightly modified version of ieHtmlWindow from the demo directory - it runs like a charm when run directly or instantiated alone in a frame.
So far this works perfectly in terms of every other aspect of what I want to do (i.e. menubar, toolbar and eventhandler stuff), and it initializes & displays the new panel just fine. That's where I run into two problems.
1) The image displays, the window's scrollbar displays, but nothing works until I manually resize the frame. I have tried Layout(), Refresh(), Update() at all three levels (frame_1, frame_1.window_1, and frame_1.window_1_pane_2) without success. I have also tried frame_1.Resize((x, y,)) with no luck. I have only tried inserting commands as the next line after the snippet I've shown here, though, so that might be the problem. But I was hoping this could happen inside the MainFrame.Swap method....
2) Same thing as above, with respect to focus of the window. The links don't link, the buttons at the top don't work, nothing. Again, the file being swapped in runs perfectly when run alone outside this application. I've tried Raise(), SetFocus(), Enable(), and again, at all three levels - frame, window, & pane.
Any ideas greatly appreciated. Mine certainly don't work.