Re: [Fxruby-users] How to show stuff created at run time (not the easy question)
Status: Inactive
Brought to you by:
lyle
From: Lyle J. <ly...@kn...> - 2003-12-10 00:51:19
|
On Dec 9, 2003, at 6:08 PM, Will Merrell wrote: > One of my questions is how to add gui elements at run time. Now I know > all > about needing to call create and all of that, and if you check out the > included code below, you'll see that I am doing so. The problem is > that when > I do what I think is proper, the added elemnts do not show up. The > weird > part is that if I resize the dialog, then they suddenly show up working > fine. In fact if I add two lines to programatically resize it (as > shown in > the code,) then the dialog works exactly as it should. But that seems > like a > really hokie hack job, and I can't believe it is the proper way to do > it. > So, what is? Have not tried running your sample code yet, but see what happens if you replace the calls to resize() with a call to recalc(): @inspectordlg.recalc I see another potential problem with the code, which is that every call to ObjectInspector#set adds a new FXMatrix widget to the dialog box (@inspectordlg). Unless I'm just misreading things, I suspect that you'll want to first remove the old matrix first, i.e. def set(newobj) @targetObject = newobj # Out with the old... @propertyFrame.removeChild(@matrix) # ... and in with the new. @matrix = FXMatrix.new(@propertyFrame, ...) # ... complete matrix setup ... end Hope this helps, Lyle |