[fxruby-users] FXTextField.connect(SEL_CHANGED)

Lyle Johnson lyle at lylejohnson.name
Thu Jul 29 11:52:36 EDT 2010

On Thu, Jul 29, 2010 at 9:52 AM, Ralph Shnelvar <ralphs at dos32.com> wrote:

> As far as I can tell, the setText does, indeed, set the text but does not
> signal SEL_CHANGED.

Ah, you're right. It actually sends SEL_COMMAND for that case. I was
thinking of the multiline FXText widget, which *does* send SEL_CHANGED
in that circumstance. I don't know why Jeroen (FOX's author) made
those two inconsistent.

If I read the code correctly, it looks like FXTextField sends
SEL_CHANGED as the user makes individual changes to the text (e.g.
typing in new characters, deleting text), so that's the difference.

> Where can I find the source to FXRuby? I don't want to build ... I just want
> the source because I could not find any documentation that shows that
> setText takes two parameters.

The source code repository is here:


and the source (actually, the SWIG interface file from which the
source code is generated) for FXTextField is here:


There, you will see that the setText() method is declared as:

    /// Set the text for this label
    void setText(const FXString& text,FXbool notify=FALSE);

The second argument ("notify") is false by default, which is to say
that if you just call:

    textfield.setText("new text")

it won't send a SEL_COMMAND message to the FXTextField's target. Now,
what you might also want to see (for additional insight) is the FOX
source code to which this links. You can download the source code for
FOX 1.6 here:


and if you look at FXTextField.cpp, you'll find this definition of the function:

    // Change the text and move cursor to end
    void FXTextField::setText(const FXString& text,FXbool notify){
        if(xid) layout();
        if(notify &&

Hope this helps,


More information about the fxruby-users mailing list