Consider MailMessageButtonBlock
- derives from DetailStampButton
- which inherits from DetailSynchronizer and MenusAndToolbars.ToolbarItem
- created in detailblocks.py, ll 293-300
- and then passed in to Toolbar.template() ll 339-348
- the result of which is then invoked with .install(parcel)
- Questions:
- why template()?
- why not use usual init constructor?
- what does Toolbar.install() do?
- is it an OSAF method?
- probably, since it takes a "parcel" argument
- unless parcel is sufficiently generic for wx or something
- MenusAndToolBars.Toolbar inherits from Block.RectangularChild
- it also inherits from DynamicContainer
- do we need DynamicContainer? Hope not..
- DynamicContainer is used to handle changing child blocks
Implementing Usage of New MultiStateButton
- change line 339 of detailblocks.py
- from: markupBar = MenusAndToolbars.Toolbar.template(
- to: markupBar = Block.RectangularChild.template(
- change line 577 of Detail.py
- from: class DetailStampButton(DetailSynchronizer, MenusAndToolbars.ToolbarItem)
- to: class DetailStampButton(DetailSynchronizer, MultiStateButton)
Egad
Line 598 of Detail.py in DetailStampButton.synchronizeItemDetail has this doozy:
- self.parentBlock.widget.ToggleTool(self.toolID, shouldToggleBasedOnKind)