Search code examples
pythonwxpythonwxwidgets

GUI programing with WxPython, drag and drop problems


I would like to begin by thanking you all for taking time to try and help me out. For my dissertation project I have decided to make a network topology program (similar to somthing like Cisco packet tracer or GNS3) My program also has the added benifit of a subnet calculator. I have the basic layout complete and I feel rather confident that I will definitly complete this program, but due to a lack of information on the web regarding wxPythons drag and drop feature, I cant find anything which is specific to what I need.

What I would like is a column, or some sort of area within my frame that the user is able to select things like routers, switchs, servers, IP phones and hosts etc etc. They then have the ability to drag these network items from the column onto the topology area. They should then be able to double click the item and a new form pop up. the user can then give the item an ip address etc etc.

Please do not think I am asking for someone todo this for me, I am simply wondering if someone could help me out by suggesting wxPython tools that could suit the needs that I have stated. If anyone has had experience with this kind of thing then please could you shed some light on it for me. I would be more than happy to produce my code online if you should need to see it.

Thank you in advance for your time.


Solution

  • There are Drag and Drop examples in the wxPython demo. Also see http://wiki.wxpython.org/DragAndDrop or http://zetcode.com/wxpython/draganddrop/

    Depending on how you're displaying your information in the topology area will decide how to make double-click function. For the most part, you either bind to the widget's double-click event or it's selection event and act accordingly in its handler to display the dialog or frame. When you can tell us what widget we're double-clicking on is when we'll be better able to answer that question.