[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] wxPython Message Window returns in Pygame
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] wxPython Message Window returns in Pygame
- From: "René Dudfield" <renesd@xxxxxxxxx>
- Date: Wed, 30 Jan 2008 17:00:17 +1100
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Wed, 30 Jan 2008 01:00:26 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=1l4lLwVED1wc3UAWE6x7DaoyTqzDZjeeZtF+xnxg8LU=; b=nwmuyfhAxWAWjVHDStB6emqgG2Ou7fW0dNlwIxNLb168s6UnkKRVJ/9tUPAq69g6eRw7PQHNqRytO4750mqwC/5YMnm989SI35lmVb6aY/q6XApogRr580TQ0WZdcEfcSAkHJrRNKVJgovqXbbICXDGMQG+I8aAUB+rfcvl3JuI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=KHeYDQ+d9vZ3aWhtiYSpAuwP+391QgHcJQEWeKdkkE7LbqShHj6oiiLekTgGHJNlBupcvnlzTsksCpbfrUVTHfUun5eK3qdFIgtchvu1GRz858Vd4zSGicGvMkSiJWu0qXs0cp83AXlxLqLzMXLFyUq4sehL58mB/eHDKQSUoO4=
- In-reply-to: <a62fab400801292154q3d5622ecl2770b2af1982d433@xxxxxxxxxxxxxx>
- References: <a62fab400801292154q3d5622ecl2770b2af1982d433@xxxxxxxxxxxxxx>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Note, wxpython + pygame working together are not supported because
they don't work together.
Really.
They don't get along.
http://pygame.org/wiki/gui
On Jan 30, 2008 4:54 PM, Ian Mallett <geometrian@xxxxxxxxx> wrote:
> Hi,
> I've got a Pygame window from which a wxPython window pops up. One enters
> 5 values into 5 boxes, and then clicks OK. I want those return strings!
> Instead, when I print the returned value, I get '5100'. After the window
> exits, clicking on the print window causes a crash. Here's the code:
>
> class EquationDialog(wx.Dialog):
> def __init__(
> self, parent, ID, title, size=wx.DefaultSize,
> pos=wx.DefaultPosition,
> style=wx.DEFAULT_DIALOG_STYLE
> ):
>
> pre = wx.PreDialog()
> pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
> pre.Create(parent, ID, title, pos, size, style)
>
> self.PostCreate(pre)
>
> sizer = wx.BoxSizer(wx.VERTICAL)
>
> label = wx.StaticText(self, -1, "Enter the equation(s) to graph
> below.")
> sizer.Add(label, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
>
> for equation in range(5):
> box = wx.BoxSizer(wx.HORIZONTAL)
> label = wx.StaticText(self, -1, str(equation+1)+": y = ")
> box.Add(label, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
> text = wx.TextCtrl(self, -1, "", size=(80,-1))
> box.Add(text, 1, wx.ALIGN_CENTRE|wx.ALL, 5)
> sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
>
> line = wx.StaticLine(self, -1, size=(20,-1), style=wx.LI_HORIZONTAL)
> sizer.Add(line, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.RIGHT|wx.TOP,
> 5)
>
> btnsizer = wx.StdDialogButtonSizer()
>
> if wx.Platform != "__WXMSW__":
> btn = wx.ContextHelpButton(self)
> btnsizer.AddButton(btn)
>
> btn = wx.Button(self, wx.ID_OK)
> ## btn.SetHelpText("The OK button completes the dialog")
> btn.SetDefault()
> btnsizer.AddButton(btn)
>
> btn = wx.Button(self, wx.ID_CANCEL)
> ## btn.SetHelpText("The Cancel button cancels the dialog. (Cool,
> huh?)")
> btnsizer.AddButton(btn)
> btnsizer.Realize()
>
> sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
>
> self.SetSizer(sizer)
> sizer.Fit(self)app = wx.PySimpleApp()
>
> dlg = EquationDialog(None, -1, "Set the Equation(s)", size=(350, 200),
> #style = wxCAPTION | wxSYSTEM_MENU |
> wxTHICK_FRAME
> style = wx.DEFAULT_DIALOG_STYLE
> )
> dlg.CenterOnScreen()
> val = dlg.ShowModal()
> dlg.Destroy()
>
> This last paragraph is actually in a function which is called by the main
> program. Again, the return, val, is something like 5100, no matter what I
> put in. Clicking on the console window causes a crash?!
> Thanks,
> Ian
>