[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Force an FX redraw

ritchie

2/19/2005 1:07:00 PM

Hi

I'm playing with FXRuby and want to add/delete text fields on the fly.
It seems though I need to force a redraw of the gui. Visibility and
zorder are correct cos I see my fields if I add them to original
startup drawing of the UI but not if I add them after startup.

I've tried

@parameter_frame.update
@app.repaint
@app.forceRefresh

thanks for any help

R

6 Answers

martinus

2/19/2005 1:44:00 PM

0

> I'm playing with FXRuby and want to add/delete text fields on the fly.
> It seems though I need to force a redraw of the gui. Visibility and
> zorder are correct cos I see my fields if I add them to original
> startup drawing of the UI but not if I add them after startup.

try @parameter_frame.recalc

martinus



ritchie

2/19/2005 2:28:00 PM

0

That didn;t work, here's what I'mdoing now

simplelist.connect(SEL_CLICKED) { |x,y,selected|
command = simplelist.getItemData(selected)
params = Commands.commands[command]["params"]
@intTarget = FXDataTarget.new(1)
params.each { |ah|
p "here with #{ah}"
a = FXLabel.new(@parameter_frame, ah, nil)
b = FXTextField.new(@parameter_frame, 10, @intTarget,
FXDataTarget::ID_VALUE)

}

@parameter_frame.recalc
@parameter_frame.raiseWindow
@parameter_frame.update
@parameter_frame.forceRefresh
@app.repaint
@app.forceRefresh
p "nchile #{@parameter_frame.numChildren}"
p "shown" if @parameter_frame.shown?
}

@parameter_frame is an FXMatrix and it already has 2 fields in it that
I can already see, the nchildren and shown? report what I expect.

Any other ideas?

Thanks

R

Hal E. Fulton

2/19/2005 6:17:00 PM

0

ritchie@ipowerhouse.com wrote:
> That didn;t work, here's what I'mdoing now

[snip]

This sounds familiar to me; is it a #create issue?
Sometimes you need to explicitly call create when
it doesn't get called implicitly.

Hal



ritchie

2/20/2005 1:00:00 AM

0

thank you that worked!! is that a problem with the bindings or fox
itself?

thanks again

R

Lyle Johnson

2/20/2005 1:03:00 AM

0

On Sat, 19 Feb 2005 23:29:55 +0900, ritchie@ipowerhouse.com
<ritchie@ipowerhouse.com> wrote:

> That didn;t work, here's what I'mdoing now...

<snip>

Hal is right; you need to be calling create() on each new label and
text field that you construct.


ritchie

2/20/2005 1:14:00 AM

0

so the problem is not the bindings or fox only that I haven't seen
#create used in the examples I've looked at so far.

thanks for the library it's really good so far.

R