- Combobox reading out current item

Dear all,

I’d like to read out the current item of a combobox.
In the documentation about FOX, there’s a promise
that for some developer version 1.5.x, it’s
possible to access FXCombobox using SEL_CHANGED
I’m using FXRuby and Fox 1.6., as provided in the brand-new one-click
installer
for Windows version.
But this doesn’t seem to work.

@cb=FXComboBox.new(self, 21, eval(’@’ (mailto:’@’) + m_label),
0,COMBOBOX_STATIC|FRAME_SUNKEN|FRAME_THICK|LAYOUT_RIGHT){|cb|
for i in [email protected]_ (mailto:[email protected])
cb.appendItem(@array[i])
end
}

ok so far, for the creation of the combobox

@cb.connect(SEL_CHANGED){ p ‘you changed me!’ }

but then no output when I click on it … :frowning:

Thanks in advance,

Best regards,

Axel

On 7/8/06, [email protected] [email protected] wrote:

I’d like to read out the current item of a combobox.
In the documentation about FOX, there’s a promise
that for some developer version 1.5.x, it’s
possible to access FXCombobox using SEL_CHANGED…
But this doesn’t seem to work.

I will file a bug report on your behalf. In the meantime, just catch
SEL_COMMAND instead. Also, I’m pretty sure that you need to fix your
call to FXComboBox.new. The third argument should be a reference to
the target (an FXObject instance). In your case, it should probably
just be nil:

@cb = FXComboBox.new(self, 21, nil, 0,
         COMBOBOX_STATIC|FRAME_SUNKEN|FRAME_THICK|LAYOUT_RIGHT) {
  ...
}

Also, as fascinating as this must be for the readers of ruby-talk, you
might want to consider posting FXRuby-specific stuff like this to the
fxruby-users mailing list instead.

Hope this helps,

Lyle

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs