![]() |
wxPython listboxsize
well thanks to sane ive started looking at GUI already using wxPython, however i am having a small issue. I am using the code below to try to produce a 200x380 list bow however, when i run my code i get a very small list box in the top left corner which is correct positioning but completley the wrong size. After looking over my code i cannot see where i am making the mistake. So i would be greatful if you could shed some light on the situation
:
Thanks |
Re: wxPython listboxsize
I believe the size parameter must be of the type "wx.Size", and not a tuple. This may or may not fix the problem. If it does not fix the problem, it may have to do with the size of your panel and slider. A control can only take up a maximum size of what it's being placed inside.
Try: :
self.listbox = wx.ListBox(panel, -1,size=wx.Size(200,380)) |
Re: wxPython listboxsize
Ah, how foolish of me. Thank you for pointing out the obvious. I had forgot to specify the size of the panel. Meaning it was it default size which is something like 10x10.
it doesn't need to be of type wx.Size() it accepts tuples perfectly well. But thanks for showing me the obvoius. Im glad i decided to look at wxPython after looking at it and Tkinter it is the better in my opionion. Chris |
Re: wxPython listboxsize
Oh, so it does accept tuples as well? And all this time I've been using wx.Size and wx.Point everywhere. What a waste of keystrokes. Haha.
I would assume wxPython is more geared towards making powerful GUIs, to obtain complete control over the class hierarchy of events and windows. If you want a simple GUI, Tkinter may be the better choice. It's always good to try out both and see which one works for you. Good luck. |
Re: wxPython listboxsize
Yes thats the impression i got from the two. I did have a quick reader of Tkinter and i much prefer wxPython, hehe i guess you can always learn something new xD
|
| All times are GMT -5. The time now is 4:14 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC