[fxruby-users] Option Menu problem (list to long)

lyle@knology.net lyle at knology.net
Thu Feb 2 10:34:14 EST 2006


On Thu, 2 Feb 2006 16:28:13 +0100, "Brutyn Nick hotmail"
<brutyn_nick at hotmail.com> wrote :

> ..but i cant seem to get the method getGeotagsByClient() activated
> 
> Must the target be another listbox?
> 
> and if i try
>  @clientListBox = FXListBox.new(matrix, getGeotagsByClient(), 
> 0,(FRAME_RAISED|FRAME_THICK|
>    JUSTIFY_HZ_APART|ICON_AFTER_TEXT|LAYOUT_RIGHT|LAYOUT_CENTER_Y))
> 
> He says the method doesnt exist.

Who is "he"? And why are you passing the return value of
"getGeotagsByClient()" as the second argument of FXListBox.new? That should
probably be nil:

    @clientListBox = FXListBox.new(matrix, nil, 0, ...)

Since FXListBox sends SEL_COMMAND when one its items is selected, you need
to catch that message:

    @clientListBox.connect(SEL_COMMAND) do |sender, sel, data|
      # put message handling code here
    end

and since the documentation told you that the message data is an integer
indicating the selected item's index:

    @clientListBox.connect(SEL_COMMAND) do |sender, sel, data|
      puts "item #{data} was selected"
    end

Hope this helps,

Lyle


More information about the fxruby-users mailing list