Hi Just checked in a fix for this in revision 1152826.
Because of inherited style information, we needed to invalidate the entire NodeView hierarchy. Regards, Noel. Bill van Melle wrote: > On Wed, Jul 27, 2011 at 12:11 AM, Noel Grandin <[email protected]> wrote: >> The way it works at the moment is that it traverses up the document >> hierarchy to find the first parent node that has a >> font set. >> >> So you can set the font on the Document object as long as no font is set at >> a lower level. > Well, I was hoping it would be that simple, but it doesn't seem to be. > I tried to construct a simple example, and ended up with something > curious: > > <Window title="Font change" maximized="true" > xmlns:bxml="http://pivot.apache.org/bxml" > xmlns="org.apache.pivot.wtk"> > <BoxPane orientation="vertical" styles="{fill:true}"> > <PushButton buttonData="Change"> > <buttonPressListeners> > function buttonPressed(button) { > doc.setFont("serif"); > } > </buttonPressListeners> > </PushButton> > <TextPane> > <Document xmlns="org.apache.pivot.wtk.text" bxml:id="doc"> > <Paragraph> > <TextNode > text="The way it works at the moment is that it traverses > up the document hierarchy to find the first parent node that has a > font set." /> > </Paragraph> > <Paragraph> > <TextNode > text="So you can set the font on the Document object as > long as no font is set at a lower level." /> > </Paragraph> > </Document> > </TextPane> > </BoxPane> > </Window> > > When you push the "Change" button, it does a setFont on the doc > element. It doesn't work. HOWEVER, if you remove the > 'styles="{fill:true}"' from the BoxPane, which ought not to have > anything to do with anything, now the Change button works. What's up > with that?
