1 #include <Application.h> 2 #include <ChannelSlider.h> 3 #include <Window.h> 4 5 class MainWindow : public BWindow { 6 public: 7 MainWindow() 8 :BWindow(BRect(50, 50, 250, 360), "window", B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS) 9 { 10 BChannelSlider *slider = new BChannelSlider(BRect(20, 10, 180, 190), 11 "vertical slider", "vertical slider", new BMessage('test'), 4); 12 AddChild(slider); 13 BChannelSlider *horizontal = new BChannelSlider(BRect(20, 200, 180, 300), 14 "horizontal slider", "horizontal slider", new BMessage('test'), 3); 15 AddChild(horizontal); 16 } 17 18 virtual bool QuitRequested() { be_app->PostMessage(B_QUIT_REQUESTED); return BWindow::QuitRequested() ; } 19 }; 20 21 22 class App : public BApplication { 23 public: 24 App() : BApplication("application/x-vnd.channelslidertest") 25 { 26 } 27 28 virtual void ReadyToRun() 29 { 30 (new MainWindow())->Show(); 31 } 32 33 }; 34 35 int main() 36 { 37 App app; 38 39 app.Run(); 40 41 return 0; 42 }