My assumption is that name="frame" corresponds to 'id', and that the XRCID() function uses the name 'frame' to return a numeric id. Is that correct?
Essentially, yes. XRC keeps a data structure that maps names to IDs and when a new name is encountered it generates a new ID using wxNewId. The standard IDs, such as wx.ID_OK, wx.ID_OPEN, etc. are preloaded into that data structure.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Essentially, yes. XRC keeps a data structure that maps names to IDs and when a new name is encountered it generates a new ID using wxNewId. The standard IDs, such as wx.ID_OK, wx.ID_OPEN, etc. are preloaded into that data structure.
I'm writing a really basic tutorial on XRC (to help myself, and anyone else just starting out)
That'll be a definite help. Just to be clear, are you documenting the XRC format, XRCed, or both?
Robin, while we're on the subject, there's something I'd like to see documented: what's the status and plans for the XRC format? In particular, is there (a plan for) something like a DTD or schema for XRC? I suspect that, as it gains popularity, something like this will be needed to keep sanity among the tools and libraries that produce and consume XRC documents.
Don Dwiggins wrote:
> John Salerno wrote:
>> I'm writing a really basic tutorial on XRC (to help myself, and anyone
>> else just starting out)
>
> That'll be a definite help. Just to be clear, are you documenting the
> XRC format, XRCed, or both?
I mention XRCed and show some screenshots, but mainly it's focused on how to create an XRC file, and then how to use it in the Python program. It's almost done, then I'll post it here so you guys can make sure nothing is wrong, if you want to.
I'm writing a really basic tutorial on XRC (to help myself, and anyone else just starting out)
That'll be a definite help. Just to be clear, are you documenting the XRC format, XRCed, or both?
Robin, while we're on the subject, there's something I'd like to see documented: what's the status and plans for the XRC format? In particular, is there (a plan for) something like a DTD or schema for XRC? I suspect that, as it gains popularity, something like this will be needed to keep sanity among the tools and libraries that produce and consume XRC documents.
Not that I know of. It was discussed at one point but around the same time there was also some discussion about a richer meta-data model where the widgets themselves would define what their attributes and properties are, and that the next-gen XRC would then be totally driven from that. This means that validation of the XML would basically be dynamic based on what the widget reports that it can do. A lot of work was done in this direction, but it staled at about half-way and is not complete yet.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I mention XRCed and show some screenshots, but mainly it's focused on how to create an XRC file, and then how to use it in the Python program. It's almost done, then I'll post it here so you guys can make sure nothing is wrong, if you want to.
OK, good. Have you looked at the existing writeups on the wiki? It might be worth incorporating them into a combined document.