Skip to content
This repository was archived by the owner on Dec 25, 2025. It is now read-only.
This repository was archived by the owner on Dec 25, 2025. It is now read-only.

funtion move_on_top() doesn't work in example solitaire #204

Description

@15921483570

flet version: 0.28.3
python version: 3.9.6
OS: mac m1(12.7.6) , android

I'm writing a demo after this tutorial:

https://flet.dev/docs/tutorials/python-solitaire#summary

until Step 3: Adding a second card.

funtion move_on_top() doesn't work using the code from the link below this part

https://github.com/flet-dev/examples/blob/main/python/tutorials/solitaire/solitaire-drag-and-drop/step3.py

i.e, the green card is still under the yellow one.

is there any changes? or should I update any control?

key code:

def move_on_top(card, controls):
    """Moves draggable card to the top of the stack"""
    controls.remove(card)
    controls.append(card)
    page.update()

def start_drag(e: ft.DragStartEvent):
    move_on_top(e.control, controls)
    solitaire.start_top = e.control.top
    solitaire.start_left = e.control.left

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions