<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Using TQt Main Window Classes</h1>
[ <ahref="motif-walkthrough-5.html">Previous: Using Existing Dialogs with TQMotifDialog</a> ]
<trbgcolor="#a2c511"><thvalign="top"colspan="3"rowspan="1"> File menu
<trbgcolor="#f0f0f0"><tdvalign="top">New <tdvalign="top"><tt>MainWindow::fileNew()</tt><tdvalign="top">calls the <tt>New()</tt> callback
<trbgcolor="#d0d0d0"><tdvalign="top">Open <tdvalign="top"><tt>MainWindow::fileOpen()</tt><tdvalign="top">calls the <tt>Open()</tt> callback
<trbgcolor="#f0f0f0"><tdvalign="top">Save <tdvalign="top"><tt>MainWindow::fileSave()</tt><tdvalign="top">calls the <tt>SaveIt()</tt> callback
<trbgcolor="#d0d0d0"><tdvalign="top">Save As <tdvalign="top"><tt>MainWindow::fileSaveAs()</tt><tdvalign="top">calls the <tt>Save()</tt> callback
<trbgcolor="#f0f0f0"><tdvalign="top">Print <tdvalign="top"><tt>MainWindow::filePrint()</tt><tdvalign="top">calls the <tt>ShowPrintDialog()</tt> callback
<trbgcolor="#a2c511"><thvalign="top"colspan="3"rowspan="1"> Selected menu
<trbgcolor="#f0f0f0"><tdvalign="top">Properties <tdvalign="top"><tt>MainWindow::selProperties()</tt><tdvalign="top">calls the <tt>EditPage()</tt> callback
<trbgcolor="#d0d0d0"><tdvalign="top">New <tdvalign="top"><tt>MainWindow::selNewPage()</tt><tdvalign="top">calls the <tt>NewPage()</tt> callback
<trbgcolor="#f0f0f0"><tdvalign="top">Delete to Trash <tdvalign="top"><tt>MainWindow::selDeletePage()</tt><tdvalign="top">calls the <tt>DeletePage()</tt> callback
</table></center>
<p> We need to add forward declarations for these callbacks before we can
use them.
<p><pre></pre>
<p> Each of the existing callback functions takes three arguments. We pass
<em>NULL</em> to all of the arguments in this example (with a few exceptions,
see below). The existing code does not rely on any of the arguments.
Each slot implementation is a single line calling the related callback
function. The code is not very interesting and would just take up
space, so we've omitted it.
<p> There are four exceptions to the above. The <tt>Open()</tt>, <tt>Save()</tt>, <tt>EditPage()</tt> and <tt>DeletePage()</tt> callbacks accept a pointer to the
<p> In <tt>main()</tt>, we make the large changes. First, we use our new <tt>MainWindow</tt> instead of <ahref="tqmotifwidget.html">TQMotifWidget</a> with <tt>XmMainWindow</tt>.