From: bartek w. <ba...@re...> - 2004-08-12 11:51:42
|
It seems that my message didn't make it to the list, so I'm resending in. I'm sorry if it will appear more than once. Hi, I'm trying to embed Pythoncard in an existing wxPython Application. What I want to do is to open a pythoncard background as a child window of my wxpython app. The problem I have is that I can either try to use model.childWindow(wxApp,someClass) - but it does not work as wxApp has no stack model.PythonCardApp(someClass) - which does the wxApp initialization again and breaks everything. There should be at least one (and preferably only one) elegant method to do it. Anyone has any ideas ? Thanks for any help in advance -- Bartek Wilczynski |
From: Bartosz <ba...@mi...> - 2004-08-12 06:51:40
|
Hi, I'm trying to embed Pythoncard in an existing wxPython Application. What I want to do is to open a pythoncard background as a child window of my wxpython app. The problem I have is that I can either try to use model.childWindow(wxApp,someClass) - but it does not work as wxApp has no stack model.PythonCardApp(someClass) - which does the wxApp initialization again and breaks everything. There should be at least one (and preferably only one) elegant method to do it. Anyone has any ideas ? Thanks for any help in advance -- Bartek Wilczynski |
From: Kevin A. <al...@se...> - 2004-08-12 15:44:42
|
I don't think you're going to be able to do this without some clunky=20 workaround. If you created a background that isn't visible as your main=20= PythonCard window and started as a PythonCard app, then your wxPython=20 window could be set to be your main top level window and it would look=20= just the same as if you started as a wxPython app. When you need to=20 create your PythonCard child window you can call child window using the=20= hidden window as the parent then store a reference to the child in your=20= wxPython window as well. There is a lot of initialization that is done for PythonCard when the=20 application is created, so without having a base PythonCard app a lot=20 of variables just don't exist. The childWindow function itself is very=20= simple, so you could do your own version to work around the parent=20 problem. ka On Aug 11, 2004, at 11:55 PM, Bartosz Wilczy=A8=BDski wrote: > Hi, > > I'm trying to embed Pythoncard in an existing wxPython Application.=20 > What I want > to do is to open a pythoncard background as a child window of my=20 > wxpython app. > > The problem I have is that I can either try to use > > model.childWindow(wxApp,someClass) > > - but it does not work as wxApp has no stack > > model.PythonCardApp(someClass) > > - which does the wxApp initialization again and breaks everything. > > There should be at least one (and preferably only one) elegant method=20= > to do it. > > Anyone has any ideas ? > > Thanks for any help in advance > -- > Bartek Wilczynski |
From: Bartosz <ba...@mi...> - 2004-08-12 16:42:09
|
Thanks for your quick response, If I understand You correctly, I should, in a way, wrap my whole wxPython Application in a non visible PythonCard App, but it brings me to another question : How do I start my wxPython App as a child window of PythonCardApp ? Thanks again for your help (and for PythonCard in general :) -- Bartek Wilczynski Citing Kevin Altis <al...@se...>: > I don't think you're going to be able to do this without some clunky > workaround. If you created a background that isn't visible as your main > PythonCard window and started as a PythonCard app, then your wxPython > window could be set to be your main top level window and it would look > just the same as if you started as a wxPython app. When you need to > create your PythonCard child window you can call child window using the > hidden window as the parent then store a reference to the child in your > wxPython window as well. > > There is a lot of initialization that is done for PythonCard when the > application is created, so without having a base PythonCard app a lot > of variables just don't exist. The childWindow function itself is very > simple, so you could do your own version to work around the parent > problem. > > ka > On Aug 11, 2004, at 11:55 PM, Bartosz Wilczy¨˝ski wrote: |
From: Kevin A. <al...@se...> - 2004-08-12 17:28:58
|
On Aug 12, 2004, at 9:45 AM, Bartosz Wilczy=A8=BDski wrote: > Thanks for your quick response, > > If I understand You correctly, I should, in a way, wrap my whole=20 > wxPython > Application in a non visible PythonCard App, > but it brings me to another question : > > How do I start my wxPython App as a child window of PythonCardApp ? > > Thanks again for your help (and for PythonCard in general :) > --=20 > Bartek Wilczynski > You won't be able to start another wx.App instance. Instead you'll just=20= move whatever app initialization you need and make your own wx.Frames=20 child windows of the main PythonCard background which can be created=20 during the openBackground event handler. For example, here's a simple=20 addition to the minimal sample using PythonCard 0.7.3.1 syntax. import wx class Minimal(model.Background): def on_openBackground(self, event): self.rawWx =3D wx.Frame(self, -1, 'plain wxPython window',=20 pos=3D(100, 30), size=3D(200, 100)) self.rawWx.Show() =00 You could subclass model.PythonCardApp, call its __init__ as part of=20 your __init__ and then do the rest of your initialization there. ka |
From: bartek w. <ba...@re...> - 2004-08-12 18:33:41
|
Great thanks, I think I'm getting to the final solution (or rather workaround ;). The only thing I can't do is creating this "invisible" PythonCard background - i can run everything fine, but the resource i have to provide need to contain at least one background - otherwise it refuses to start. -- Bartek Wilczynski Cytowanie Kevin Altis <al...@se...>: > On Aug 12, 2004, at 9:45 AM, Bartosz Wilczy¨˝ski wrote: > > > Thanks for your quick response, > > > > If I understand You correctly, I should, in a way, wrap my whole > > wxPython > > Application in a non visible PythonCard App, > > but it brings me to another question : > > > > How do I start my wxPython App as a child window of PythonCardApp ? > > > > Thanks again for your help (and for PythonCard in general :) > > -- > > Bartek Wilczynski > > > You won't be able to start another wx.App instance. Instead you'll just > move whatever app initialization you need and make your own wx.Frames > child windows of the main PythonCard background which can be created > during the openBackground event handler. For example, here's a simple > addition to the minimal sample using PythonCard 0.7.3.1 syntax. > > import wx > > class Minimal(model.Background): > def on_openBackground(self, event): > self.rawWx = wx.Frame(self, -1, 'plain wxPython window', > pos=(100, 30), size=(200, 100)) > self.rawWx.Show() > > You could subclass model.PythonCardApp, call its __init__ as part of > your __init__ and then do the rest of your initialization there. > > ka > > > ------------------------------ > Scanned for viruses by MKS_Vir > Last update: > ------------------------------ > |
From: Kevin A. <al...@se...> - 2004-08-12 19:06:54
|
On Aug 12, 2004, at 11:37 AM, bartek wilczynski wrote: > Great thanks, I think I'm getting to the final solution (or rather > workaround > ;). The only thing I can't do is creating this "invisible" PythonCard > background > - i can run everything fine, but the resource i have to provide need > to contain > at least one background - otherwise it refuses to start. > In the Background Info dialog in the resourceEditor there is an option for "Visible at Startup" which you just need to uncheck. ka |