Search code examples
smalltalksqueak

Grabbing ETOY PlayingCardDeck


I'm trying to make a game that includes playing cards. I have a sub class of BorderedMorph that I added to all of the decks. I have sub class of PlayingCardDeck that I implemented the game deck behaviour in. I didn't touched all of the dragging and dropping features in the subclass, and I get the same error you get when you try to drag and drop this:

g:= PlayingCardDeck new.
g newDeck.
g layout: #pile.
g openInWorld.

how can I repair this bug and make my game draggable, so I will be able to move it on screen (not only by pressing the scroll wheel in).

the problem is in the PlayingCardMorph because when I try to move empty deck I can do it.


Solution

  • ok my issue is resolved. the solution for me was to make sub class for PlayingCardMorph and adding the following method:

    handlesMouseDown: aMouse
        ^false
    

    hope it helps any one that needs it.