[fxruby-users] my button.connect(SEL_COMMAND) isn't working

Lyle Johnson lyle.johnson at gmail.com
Wed Mar 7 17:13:59 EST 2007


On 3/7/07, Raj Sahae <rajsahae at gmail.com> wrote:

> Is it because I'm also using the DND stuff for the same button?  Does
> the LEFBUTTONPRESS and LEFTBUTTONRELEASE mess up SEL_COMMAND?

I thought I had responded to this question when you posted it to
ruby-talk, but I can't find it in the archives now.

Yes, if you completely override the handler for SEL_LEFTBUTTONRELEASE,
the button will never get to fire its SEL_COMMAND message. You should
however be able to avoid that happening by making sure that your
SEL_LEFTBUTTONRELEASE handler returns false, e.g.

    imageView.connect(SEL_LEFTBUTTONRELEASE) do
      imageView.ungrab
      imageView.endDrag
      stack.remove(card) if data_sent
      self.display(stack, requesting_player)
      false # added this line
    end

Hope this helps,

Lyle


More information about the fxruby-users mailing list