def windowScrolled(ev):

    
    osgWidget.warn(), "scrolling up? ", ev.getWindowManager().isMouseScrollingUp()
    

    return True
def applyStyle(w, r):
    
        cs = dynamic_cast<CustomStyled*>(w)

        if  not cs : return False

        osgWidget.warn(), "Here, okay."

        return True
def doError(errorMsg):

    
    osgWidget.warn(), errorMsg

    return 1
Example #4
0
def bound(node):

    
    bs = node.getBound()

    osgWidget.warn(), "center: ", bs.center(), " radius: ", bs.radius()
    canvas.addWidget(
        createWidget("w3", 0.6, osgWidget.Widget.LAYER_HIGH),
        400.0,
        0.0
    )

    # Add a child and then resize it relatively to the size of the parent Window.
    relWidget = osgWidget.Widget("relative")

    relWidget.setLayer(osgWidget.Widget.LAYER_LOW, 1)
    relWidget.setCoordinateMode(osgWidget.Widget.CM_RELATIVE)
    relWidget.setSize(0.2, 0.2)
    relWidget.setColor(0.5, 0.5, 0.1, 0.9)

    osgWidget.warn(), canvas.getWidth()

    canvas.addWidget(relWidget, 0.4, 0.4)
    
    relWidget.addOrigin(0.1, 0.1)
    relWidget.addSize(0.2, 0.2)

    canvas.resize()

    # Finally, add the whole thing to the WindowManager.
    wm.addChild(canvas)

    return osgWidget.createExample(viewer, wm)

#
#def main(argv):