hi,
would I want a suggestion,
when I create some buttons I use a dictionary because it is more practical but I need to put them in a certain sequence,
therefore I am forced to perform a sort in this way
buttons = {0:(wx.ID_REFRESH,’&Refresh’,’&Refresh data’),
1:(wx.ID_ADD,’&Add’,’&Add something’),
2:(wx.ID_EDIT,’&Edit’,’&Edit something’),
3:(wx.ID_PRINT,’&Print’,‘Print something’),
4:(wx.ID_OPEN,’&Open’,‘Open something’),
5:(wx.ID_CLOSE,’&Close’,‘Close me’)}
items = buttons.items()
items.sort()
for k,v in items:
b = wx.Button(panel, v[0], v[1], size=(80,-1))
b.SetToolTipString(v[2])
b.Bind(wx.EVT_BUTTON, self.OnClick)
a best way exists?
I attach a demo.
regards
sampleapp.py (2.16 KB)