From d796c9dd933ab96ec83b9a634feedd5d32e1ba3f Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 8 Nov 2011 12:31:36 -0600 Subject: Test conversion to TQt3 from Qt3 8c6fc1f8e35fd264dd01c582ca5e7549b32ab731 --- doc/html/motif-customwidget-example.html | 148 +++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 doc/html/motif-customwidget-example.html (limited to 'doc/html/motif-customwidget-example.html') diff --git a/doc/html/motif-customwidget-example.html b/doc/html/motif-customwidget-example.html new file mode 100644 index 000000000..fe752f507 --- /dev/null +++ b/doc/html/motif-customwidget-example.html @@ -0,0 +1,148 @@ + + + + + +Using the Motif Event Loop + + + + + + + +
+ +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

Using the Motif Event Loop

+ + +

+

+


+

Header +

#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <qmainwindow.h>
+
+
+class TQMotifWidget;
+
+class MainWindow : public TQMainWindow
+{
+public:
+    MainWindow();
+
+private:
+    TQMotifWidget *customwidget;
+};
+
+#endif // MAINWINDOW_H
+
+ +


+

Implementation: +

#include "mainwindow.h"
+
+#include <qapplication.h>
+#include <qmotif.h>
+
+
+int main( int argc, char **argv )
+{
+    XtSetLanguageProc( NULL, NULL, NULL );
+
+    TQMotif integrator( "customwidget" );
+    TQApplication app( argc, argv );
+
+    MainWindow mainwindow;
+    app.setMainWidget( &mainwindow );
+    mainwindow.show();
+
+    return app.exec();
+}
+
+ +

#include "mainwindow.h"
+
+#include <qapplication.h>
+#include <qmenubar.h>
+#include <qpopupmenu.h>
+#include <qstatusbar.h>
+
+#include <qmotifwidget.h>
+
+#include <Xm/Form.h>
+#include <Xm/PushB.h>
+#include <Xm/Text.h>
+
+
+MainWindow::MainWindow()
+    : TQMainWindow( 0, "mainwindow" )
+{
+    TQPopupMenu *filemenu = new TQPopupMenu( this );
+    filemenu->insertItem( tr("&Quit"), qApp, SLOT(tquit()) );
+
+    menuBar()->insertItem( tr("&File"), filemenu );
+    statusBar()->message( tr("This is a TQMainWindow with an XmText widget.") );
+
+    customwidget =
+        new TQMotifWidget( this, xmFormWidgetClass, NULL, 0, "form" );
+
+    XmString str;
+    Arg args[6];
+
+    str = XmStringCreateLocalized( "Push Button (XmPushButton)" );
+    XtSetArg( args[0], XmNlabelString, str );
+    XtSetArg( args[1], XmNleftAttachment, XmATTACH_FORM );
+    XtSetArg( args[2], XmNrightAttachment, XmATTACH_FORM );
+    XtSetArg( args[3], XmNbottomAttachment, XmATTACH_FORM );
+    Widget button =
+        XmCreatePushButton( customwidget->motifWidget(), "Push Button", args, 4 );
+    XmStringFree( str );
+
+    XtSetArg( args[0], XmNeditMode, XmMULTI_LINE_EDIT );
+    XtSetArg( args[1], XmNleftAttachment, XmATTACH_FORM );
+    XtSetArg( args[2], XmNrightAttachment, XmATTACH_FORM );
+    XtSetArg( args[3], XmNtopAttachment, XmATTACH_FORM );
+    XtSetArg( args[4], XmNbottomAttachment, XmATTACH_WIDGET );
+    XtSetArg( args[5], XmNbottomWidget, button );
+    Widget texteditor =
+        XmCreateScrolledText( customwidget->motifWidget(), "Text Editor", args, 6 );
+
+    XtManageChild( texteditor );
+    XtManageChild( button );
+
+    setCentralWidget( customwidget );
+
+    resize( 400, 600 );
+}
+
+
+ +

See also TQMotif Support Extension. + + +


+ +
Copyright © 2007 +TrolltechTrademarks +
TQt 3.3.8
+
+ -- cgit v1.2.1