// //Label.cpp //Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. #include <oz++/motif/ApplicationView.h> #include <oz++/motif/Label.h> #include <oz++/motif/PixmapFile.h> namespace OZ { class MainView :public ApplicationView { private: SmartPtr<PixmapFile> pixmapf; SmartPtr<Label> label; public: MainView(Application& applet, const char* name, Args& args) :ApplicationView(applet, name, args) { Args ar; label = new Label(this, "label", ar); Pixel fg, bg; label -> get(XmNforeground, (XtArgVal)&fg); label -> get(XmNbackground, (XtArgVal)&bg); pixmapf = new PixmapFile(getDisplay(), "escherknot", fg, bg); label -> set(XmNlabelType, XmPIXMAP); label -> set(XmNlabelPixmap, (XtArgVal)pixmapf->get()); } ~MainView() { } }; } // int main(int argc, char** argv) { try { const char* appclass = argv[0]; Application applet(appclass, argc, argv); Args args; args.set(XmNgeometry, "400x300"); MainView view(applet, argv[0], args); view.realize(); applet.run(); } catch (Exception& ex) { caught(ex); } return 0; } |