Drag button between panels in wxPython

Deadly 提交于 2019-12-08 08:43:23

问题


Does anyone know of an example where it is shown how to drag a button from one panel to another in wxPython?

I have created a bitmap button in a panel, and I would like to be able to drag it to a different panel and drop I there.

I haven't found any examples using buttons, just text and files.

I am using the latest version of Python and wxPython.


回答1:


If you want to graphically represent the drag, one good way to do this is to create a borderless Frame that follows the mouse during a drag. You remove the button from your source Frame, temporarily put it in this "drag Frame", and then, when the user drops, add it to your destination Frame.



来源:https://stackoverflow.com/questions/425722/drag-button-between-panels-in-wxpython

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!