Force an FX redraw

R

ritchie

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
 
M

Martin Ankerl

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
 
R

ritchie

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
 
H

Hal Fulton

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
 
R

ritchie

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

thanks again

R
 
L

Lyle Johnson

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.
 
R

ritchie

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top