Hello,
what is the right way to do a pop-up dialog with multiple input fields (firstname, lastname, age) and get user data. As wxpython beginner I can’t figure it out. Is there any example for it?
Thanks!
Hello,
what is the right way to do a pop-up dialog with multiple input fields (firstname, lastname, age) and get user data. As wxpython beginner I can’t figure it out. Is there any example for it?
Thanks!
Maybe the sample app Mike and I did might help you.
https://bitbucket.org/driscollis/medialocker
In this we used validators to get data to/from database to controls.
Mike did a few posts on his blog about it.
If you just need something simpler then you could do something along these lines.
with yourDialog(....) as dlg:
if dlg.ShowModal() == wx.ID_OK:
fn = dlg.firstName.GetValue()
....
Try to code as much as you can and come back with your questions. If the code is not too large you can even attach it, if you do follows as much as possible - MakingSampleApps - wxPyWiki
Werner
On 18/03/2012 18:47, wxxxx wrote:
Hello,
what is the right way to do a pop-up dialog with multiple input fields (firstname, lastname, age) and get user data. As wxpython beginner I can't figure it out. Is there any example for it?
Hello,
what is the right way to do a pop-up dialog with multiple input fields
(firstname, lastname, age) and get user data. As wxpython beginner I
can’t figure it out. Is there any example for it?
Maybe the sample app Mike and I did might help you.
https://bitbucket.org/driscollis/medialocker
In this we used validators to get data to/from database to controls.
Mike did a few posts on his blog about it.
If you just need something simpler then you could do something along
these lines.
with yourDialog(…) as dlg:
if dlg.ShowModal() == wx.ID_OK:
fn = dlg.firstName.GetValue()
…
thanks for quick reply. Medialocker is pretty big app for learning from it. Will do my best.
Basically, I just want to know how to create dlg.firstName and dlg.lastName inputs for dlg. What objects should they be?
On Sunday, March 18, 2012 7:19:40 PM UTC+1, werner wrote:
On 18/03/2012 18:47, wxxxx wrote:
Try to code as much as you can and come back with your questions. If
the code is not too large you can even attach it, if you do follows as
much as possible - http://wiki.wxpython.org/MakingSampleApps
Werner
Hi,
> Hello,
> what is the right way to do a pop-up dialog with multiple input fields
> (firstname, lastname, age) and get user data. As wxpython beginner I
> can't figure it out. Is there any example for it?
Maybe the sample app Mike and I did might help you.
[...]
thanks for quick reply. Medialocker is pretty big app for learning from it.
Will do my best.Basically, I just want to know how to create dlg.firstName and dlg.lastName
inputs for dlg. What objects should they be?
You're mixing up your terminology, I think. It sounds like you need
to start with something simpler.
Take a look at the examples at Zetcode. Maybe they'll help you get on
the right track.
Try to code as much as you can and come back with your questions. If
the code is not too large you can even attach it, if you do follows as
much as possible - MakingSampleApps - wxPyWiki
That's good advice too.
Werner
HTH.
Cheers,
Scott.
On Sun, Mar 18, 2012 at 3:45 PM, wxxxx <fredgarlov00@googlemail.com> wrote:
On Sunday, March 18, 2012 7:19:40 PM UTC+1, werner wrote:
On 18/03/2012 18:47, wxxxx wrote:
Hi,
...
thanks for quick reply. Medialocker is pretty big app for learning from it. Will do my best.
Basically, I just want to know how to create dlg.firstName and dlg.lastName inputs for dlg. What objects should they be?
The wxPython demo is a good place to look for answers for this type of question, check out wx.TextCtrl and wx.lib.masked.TextCtrl (search for 'masked' in the demo).
In the tutorial Scott pointed you too there is another one which might be of interest to you:
http://zetcode.com/wxpython/databases/
Werner
On 18/03/2012 20:45, wxxxx wrote:
Also the Dialog sample in the demo has a fairly good example of a simple dialog with labels, textctrls and buttons. It also shows a few extra things, but the golden nuggets are in there too.
On 3/19/12 1:26 AM, werner wrote:
Hi,
On 18/03/2012 20:45, wxxxx wrote:
...thanks for quick reply. Medialocker is pretty big app for learning
from it. Will do my best.
Basically, I just want to know how to create dlg.firstName and
dlg.lastName inputs for dlg. What objects should they be?The wxPython demo is a good place to look for answers for this type of
question, check out wx.TextCtrl and wx.lib.masked.TextCtrl (search for
'masked' in the demo).In the tutorial Scott pointed you too there is another one which might
be of interest to you:
--
Robin Dunn
Software Craftsman
Robin,
...
Also the Dialog sample in the demo has a fairly good example of a simple dialog with labels, textctrls and buttons. It also shows a few extra things, but the golden nuggets
Where are they hidden, didn't find them;-) .
Werner
On 20/03/2012 19:35, Robin Dunn wrote:
Hi,
I would recommend subclassing wx.Dialog. That’s the easiest way. You can also read up on the various standard dialogs here: http://www.blog.pythonlibrary.org/2010/06/26/the-dialogs-of-wxpython-part-1-of-2/ or http://www.blog.pythonlibrary.org/2010/07/10/the-dialogs-of-wxpython-part-2-of-2/
Using wx.Dialog is the most flexible though and it’s pretty straight-forward too.