在wxPython中的面板之间拖动按钮 [英] Drag button between panels in wxPython

查看:188
本文介绍了在wxPython中的面板之间拖动按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道一个例子,它显示了如何在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆