From: Kevin A. <al...@se...> - 2004-09-13 20:04:22
|
On Sep 13, 2004, at 11:57 AM, bra...@om... wrote: > Good; that's what I was hoping to hear. Over the past couple of days, > I've found ways to do some of those things, though I didn't see a > widget for a tabbed interface in Resource Editor, and am not clear on > how to produce a contextual menu. > There is no built-in support for the wx.Notebook class right now, which is what you would use to do a real tabbed interface. This is mostly due to PythonCard having a "flat" layout model rather than supporting a generic container model where you could have a different layout in each notebook tab/page. This has been discussed a number of times on the mailing list and is obviously a big missing feature, but I don't really know how to support it correctly. There was one attempt to incorporate this into the framework and resourceEditor, but it was never incorporated into the main cvs code or updated for release 0.8. It is probably time for a separate discussion thread on the issues and possible solutions such as treating each page as a type of child window where only the components of the child window resource are used. I'm just brainstorming here. You would end up with a separate source and resource file for each tab/page. I guess the references to each tab layout would end up being something like self.components.notebook[0].components.field1, etc. where each page (window) of the notebook is referenced via a list. You'll also need to do the context (popup) menu yourself. For that you just create a wx.Menu in a on_somecomponent_mouseContextUp event handler or mouseContextClick in the case of a MultiColumnList. If you look at the fpop.py code in cvs you'll see an example of this http://cvs.sourceforge.net/viewcvs.py/pythoncard/PythonCard/samples/ fpop/fpop.py The relevant methods are initContextMenu and on_mclHeaders_mouseContextClick. fpop is not included as part of the normal PythonCard releases because it is too rough to allow out in the wild and people could end up deleting email accidentally. ka |