Show
Ignore:
Timestamp:
11/28/08 15:36:39 (6 years ago)
Author:
robert
Message:

From Jeremy Moles, updates to osgwidget examples.

Merged by Robert Osfield from OpenSceneGraph-osgWidget-dev

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgwidgetscrolled/osgwidgetscrolled.cpp

    r8602 r9289  
    11// -*-c++-*- osgWidget - Code by: Jeremy Moles (cubicool) 2007-2008 
    22// $Id: osgwidgetframe.cpp 34 2008-04-07 03:12:41Z cubicool $ 
     3 
     4#include <osgDB/ReadFile> 
    35 
    46#include <osgWidget/Util> 
     
    8587        MASK_2D, 
    8688        osgWidget::WindowManager::WM_PICK_DEBUG 
     89        //osgWidget::WindowManager::WM_NO_INVERT_Y 
    8790    ); 
    8891     
    89     osgWidget::Frame* frame = osgWidget::Frame::createSimpleFrameWithSingleTexture( 
     92    osgWidget::Frame* frame = osgWidget::Frame::createSimpleFrameFromTheme( 
    9093        "frame", 
    91         "osgWidget/theme-2.png", 
    92         64.0f, 
    93         64.0f, 
    94         16.0f, 
    95         16.0f, 
    96         100.0f, 
    97         100.0f 
     94        osgDB::readImageFile("osgWidget/theme.png"), 
     95        40.0f, 
     96        40.0f, 
     97        osgWidget::Frame::FRAME_ALL 
    9898    ); 
    9999 
     
    123123    box->setEventMask(osgWidget::EVENT_NONE); 
    124124 
    125     frame->getEmbeddedWindow()->setWindow(box); 
     125    //frame->getEmbeddedWindow()->setWindow(box); 
     126    frame->setWindow(box); 
    126127    frame->getEmbeddedWindow()->setColor(1.0f, 1.0f, 1.0f, 1.0f); 
    127128    frame->resize(300.0f, 300.0f); 
    128     frame->addCallback(osgWidget::Callback(&scrollWindow, osgWidget::EVENT_MOUSE_SCROLL)); 
    129     frame->addCallback(osgWidget::Callback(&changeTheme, osgWidget::EVENT_KEY_DOWN)); 
     129    frame->addCallback(new osgWidget::Callback(&scrollWindow, osgWidget::EVENT_MOUSE_SCROLL)); 
     130    frame->addCallback(new osgWidget::Callback(&changeTheme, osgWidget::EVENT_KEY_DOWN)); 
    130131 
    131132    wm->addChild(frame);