Forum: Ruby another FXRuby question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Raj S. (Guest)
on 2007-03-04 02:30
(Received via mailing list)
I have some button that do DND, but I also want to click them to perform
some actions.
I'm not sure, but right now it seems like my
imageView.connect(SEL_COMMAND) isn't doing anything.
The puts I have in there never get outputted.

imageView= FXButton.new(@stackViewer, nil, nil, nil, 0,
  LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT|BUTTON_NORMAL, 0,0, 357, 497)
imageView.icon = FXJPGIcon.new(self.getApp(), file.read,
IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP)
#set action for selected button
imageView.connect(SEL_COMMAND) do
  put "in imageView.connect"
  if card.commander == requesting_player
    puts card.stopped
    card.stopped ? stack.unstop(card) : stack.stop(card)
    self.display(stack, requesting_player)
  end
end
#set DND for cards in viewer
imageView.connect(SEL_LEFTBUTTONPRESS) do
  imageView.grab
  dragTypes = [@image_drag_type]
  imageView.beginDrag(dragTypes)
end
imageView.connect(SEL_MOTION) do |sender, sel, event|
  if imageView.dragging?
    imageView.handleDrag(event.root_x, event.root_y)
    unless imageView.didAccept == DRAG_REJECT
      imageView.dragCursor =
self.getApp().getDefaultCursor(DEF_DNDMOVE_CURSOR)
    else
      imageView.dragCursor =
self.getApp().getDefaultCursor(DEF_DNDSTOP_CURSOR)
    end
  end
end
imageView.connect(SEL_LEFTBUTTONRELEASE) do
  imageView.ungrab
  imageView.endDrag
  stack.remove(card) if data_sent
  self.display(stack, requesting_player)
end
imageView.connect(SEL_DND_REQUEST) do |sender, sel, event|
  if event.target == @image_drag_type
    imageView.setDNDData(FROM_DRAGNDROP, @image_drag_type,
      Fox.fxencodeStringData(card.to_s))
    data_sent = true
  end
end
imageView.create
This topic is locked and can not be replied to.