wxPython newbie question, creating "mega widgets" , and DnD

A

akameswaran

I've made the switch from tKinter to wxPython. I'm slowly trying to
learn it, but I had a question - what is the appropriate object to
subclass to create a "mega widget" ie A listbox with it's add/delete
buttons already built in?

wxPanel seems a possibility - any thoughts?

A side question - why is their a EVT_LIST_BEGIN_DRAG but no
EVT_LIST_END_DRAG, unlike tree's which have BEGIN and END? I need a
draggable list box, and would prefer to not handle low level mouse
events.
 
C

Chris Cioffi

I've made the switch from tKinter to wxPython. I'm slowly trying to
learn it, but I had a question - what is the appropriate object to
subclass to create a "mega widget" ie A listbox with it's add/delete
buttons already built in?

wxPanel seems a possibility - any thoughts?

When I've created this type of thing I usually start with a wx.Panel.
It will depend on how you plan to use your new mega-widget, but I
suspect that the wx.Panel gives you the most flexibility. You can
throw a panel pretty much anywhere and it seems to work just fine. :)

PS: Congrats on giving wxPython a try. It's far from the perfect
framework, but it seems the most Pythonic to me and lets me get the
most accomplished with the least setup. YMMV.
 
L

Lonnie Princehouse

Yes, wx.Panel.
A side question - why is their a EVT_LIST_BEGIN_DRAG but no
EVT_LIST_END_DRAG, unlike tree's which have BEGIN and END? I need a
draggable list box, and would prefer to not handle low level mouse
events.

Dunno. There is an EVT_LIST_COL_END_DRAG, though, maybe that will help.
 
M

Max Erickson

A side question - why is their a EVT_LIST_BEGIN_DRAG but no
EVT_LIST_END_DRAG, unlike tree's which have BEGIN and END? I
need a draggable list box, and would prefer to not handle low
level mouse events.

My intuition(so take it with a grain of salt) says that it wouldn't
make any sense for the list control to generate an event when the drag
and drop lands on a different control.

max
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top