在wxPython中的面板之间拖动按钮 [英] Drag button between panels in wxPython
问题描述
我已经在面板中创建了一个位图按钮,我想把它拖到一个不同的面板,放在我那里。
我没有发现任何使用按钮,只是文本和文件的示例。
我正在使用最新的版本的Python和wxPython。
如果要以图形方式表示拖动,一个很好的方法是创建一个在拖动期间跟随鼠标的无边框框架。您从源框架中删除按钮,暂时将其放在此拖动框架中,然后在用户丢弃时将其添加到目标框架。
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.
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.
这篇关于在wxPython中的面板之间拖动按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!