# Another FXRuby question

**URL:** <https://www.ruby-forum.com/t/another-fxruby-question/87570>\
**Category:** Ruby\
**Created:** [March 4, 2007, 1:30am UTC](https://www.ruby-forum.com/t/another-fxruby-question/87570 "2007-03-04T01:30:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dorelal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3da27b/32.png) [@dorelal](https://www.ruby-forum.com/u/dorelal)\
**Post date:** [March 4, 2007, 1:30am UTC](https://www.ruby-forum.com/t/another-fxruby-question/87570/1 "2007-03-04T01:30:05Z")

</div>

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
