return values from multiline dialog ?

hello,

I'm creating a multi value dialog box ( a number of strings the user can edit),
I read that the values can be returned by a validator,
but isn't there an easier way if I don't want to validate the user entered values ?

thanks,
Stef Mientki

You could replace the ShowModal function. For example, if your dialog had controls A, B, and C:

class MyDialog(wx.Dialog):

def ShowModal(self, A, B, C):

self.A.SetValue(A)

self.B.SetValue(B)

self.C.SetValue(C)

if wx.Dialog.ShowModal(self) == wx.ID_OK:

return self.A.GetValue(), self.B.GetValue(), self.C.GetValue()

else:

return A, B, C # (Cancel or close)

···

On 10/1/07, Stef Mientki s.mientki@ru.nl wrote:

hello,

I’m creating a multi value dialog box ( a number of strings the user can
edit),
I read that the values can be returned by a validator,

but isn’t there an easier way if I don’t want to validate the user
entered values ?

thanks,
Stef Mientki


To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

thanks,
that what I was looking for,
so obvious :wink:

cheers,
Stef

Gre7g Luterman wrote:

···

You could replace the ShowModal function. For example, if your dialog had controls A, B, and C:
class MyDialog(wx.Dialog):
    def ShowModal(self, A, B, C):
        self.A.SetValue(A)
        self.B.SetValue(B)
        self.C.SetValue(C)
        if wx.Dialog.ShowModal(self) == wx.ID_OK:
            return self.A.GetValue(), self.B.GetValue(), self.C.GetValue()
        else:
            return A, B, C # (Cancel or close)
On 10/1/07, *Stef Mientki* <s.mientki@ru.nl <mailto:s.mientki@ru.nl>> > wrote:

    hello,

    I'm creating a multi value dialog box ( a number of strings the
    user can
    edit),
    I read that the values can be returned by a validator,
    but isn't there an easier way if I don't want to validate the user
    entered values ?

    thanks,
    Stef Mientki

    ---------------------------------------------------------------------
    To unsubscribe, e-mail:
    wxPython-users-unsubscribe@lists.wxwidgets.org
    <mailto:wxPython-users-unsubscribe@lists.wxwidgets.org>
    For additional commands, e-mail:
    wxPython-users-help@lists.wxwidgets.org
    <mailto:wxPython-users-help@lists.wxwidgets.org>