summaryrefslogtreecommitdiffstats
path: root/doc/html/motif-extension.html
blob: 8e42fd4a8ac0998fe95475b429aaa075b842aa9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/extensions/motif/doc/index.doc:3 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQt Motif Extension</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQt Motif Extension</h1>

 
<p> <!-- index Motif --><a name="Motif"></a>
<p> This module is part of the <a href="commercialeditions.html">TQt Enterprise
Edition</a> and is <em>not</em> part of the Free or Non-Commercial
Editions.
<p> <h2> Introduction
</h2>
<a name="1"></a><p> The TQt Motif Extension assists the migration of old Xt and Motif based
applications to the more comfortable TQt toolkit.  This extension
replaces the older Xt/Motif Support Extension included with earlier
versions of TQt.
<p> The TQt Motif Extension consists of the following classes:
<p> <ul>
<li> <a href="qmotif.html">TQMotif</a> - Provides the basis of the TQt Motif Extension.
<li> <a href="qmotifwidget.html">TQMotifWidget</a> - Provides the <a href="tqwidget.html">TQWidget</a> API for Motif widgets.
<li> <a href="qmotifdialog.html">TQMotifDialog</a> - Provides the <a href="ntqdialog.html">TQDialog</a> API for Motif dialogs.
<li> <a href="qxtwidget.html">TQXtWidget</a> - The Xt/Motif integration widget from the previous
Xt/Motif extension.  This class is unsupported and has many known
problems and limitations.  It is provided only to keep existing source
working; it should not be used in new code.
</ul>
<p> <h3> Additional Documentation
</h3>
<a name="1-1"></a><p> <ul>
<p> <li> <a href="motif-examples.html">Examples</a>
<li> <a href="motif-walkthrough.html">Migration Walkthrough</a> - A
complete migration of a Motif based program to the TQt toolkit.
<p> </ul>
<p> <h2> Common Problems
</h2>
<a name="2"></a><p> <h3> Incorrect CDE Color Scheme
</h3>
<a name="2-1"></a><p> <a href="qmotifwidget.html">TQMotifWidget</a> and <a href="qmotifdialog.html">TQMotifDialog</a> will use the same Visual, Colormap
and color depth that <a href="ntqapplication.html">TQApplication</a> uses.  When using CDE, the color
scheme may be incorrect when using a Visual, Colormap and color depth
that is not the default.  To work around this problem, add the
following resource string to your startup files (for example,
<tt>$HOME/.dt/sessions/current/dt.resources</tt>):
<p> <pre>
    *userColorObj: false
</pre>
 
<p> <h3> X11 Header Conflicts
</h3>
<a name="2-2"></a><p> The X11 headers define some constants that conflict with the TQt
headers.  The solution is to include all TQt headers first, followed by
headers from this extension, and all Xt/Motif and X11 headers last.
For example:
<p> <pre>
    // TQt headers first
    #include &lt;<a href="qapplication-h.html">ntqapplication.h</a>&gt;
    #include &lt;<a href="qpushbutton-h.html">ntqpushbutton.h</a>&gt;
    #include &lt;<a href="tqsocket-h.html">tqsocket.h</a>&gt;
    ...

    // TQMotif* headers next
    #include &lt;<a href="qmotif-h.html">qmotif.h</a>&gt;
    #include &lt;<a href="qmotifdialog-h.html">qmotifdialog.h</a>&gt;
    #include &lt;<a href="qmotifwidget-h.html">qmotifwidget.h</a>&gt;

    // Xt/Motif and X11 headers last
    #include &lt;X11/Xlib.h&gt;
    #include &lt;Xt/Intrinsic.h&gt;
    #include &lt;Xm/Xm.h&gt;
    ...
</pre>
 
<p> <h3> Multiple Screen Support
</h3>
<a name="2-3"></a><p> <a href="qmotifwidget.html">TQMotifWidget</a> can be used together with <a href="tqdesktopwidget.html">TQDesktopWidget</a> to create
top-level windows on multiple screens.  A common mistake is to create
a TQMotifWidget on a non-default screen while the Xt/Motif widgets are
created on the default screen.  The solution is to specify the screen
to both TQMotifWidget and the Xt/Motif child.  For example:
<p> <pre>
    Display *dpy = TQMotif::<a href="qmotif.html#x11Display">x11Display</a>();
    Arg args[1];

    // make sure both TQMotifWidget and the XmMainWindow are on screen 1
    XtSetArg(args[0], XtNscreen, ScreenOfDisplay(dpy, 1));
    <a href="qmotifwidget.html">TQMotifWidget</a> *toplevel =
        new <a href="qmotifwidget.html">TQMotifWidget</a>(TQApplication::<a href="ntqapplication.html#desktop">desktop</a>()-&gt;screen(1),
                         xmMainWindowWidgetClass, args, 1, "mainwindow");
</pre>
 
<p> 
<!-- eof -->
<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>TQt 3.3.8</div>
</table></div></address></body>
</html>