[5a2e7c]: manuals / vgui_ref_manual / node19.html  Maximize  Restore  History

Download this file

121 lines (108 with data), 3.6 kB

  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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 98.1 release (February 19th, 1998)
originally by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>vgui_Foo</TITLE>
<META NAME="description" CONTENT="vgui_Foo">
<META NAME="keywords" CONTENT="vgui_ref_manual">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<LINK REL="STYLESHEET" HREF="vgui_ref_manual.css">
<LINK REL="next" HREF="node20.html">
<LINK REL="previous" HREF="node18.html">
<LINK REL="up" HREF="node16.html">
<LINK REL="next" HREF="node20.html">
</HEAD>
<BODY >
<!--Navigation Panel-->
<A NAME="tex2html278"
HREF="node20.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="/usr/local/share/latex2html/icons.gif/next_motif.gif"></A>
<A NAME="tex2html275"
HREF="node16.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="/usr/local/share/latex2html/icons.gif/up_motif.gif"></A>
<A NAME="tex2html269"
HREF="node18.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="/usr/local/share/latex2html/icons.gif/previous_motif.gif"></A>
<A NAME="tex2html277"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
SRC="/usr/local/share/latex2html/icons.gif/contents_motif.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html279"
HREF="node20.html">Supporting menu bars</A>
<B> Up:</B> <A NAME="tex2html276"
HREF="node16.html">Adding a new GUI</A>
<B> Previous:</B> <A NAME="tex2html270"
HREF="node18.html">vgui_Foo_window</A>
<BR>
<BR>
<!--End of Navigation Panel-->
<H2><A NAME="SECTION00433000000000000000">
vgui_Foo</A>
</H2>
There may be some setup for the widget system that should take place in this class in
the vgui::init_impl function. The only other features to worry about are
providing the singleton methods/data
<P>
from <TT>vgui_Xm.h</TT>
<P>
<FONT SIZE="-2">
<BR>
<IMG
WIDTH="345" HEIGHT="201" ALIGN="BOTTOM" BORDER="0"
SRC="img10.gif"
ALT="class vgui_Xm : public vgui { ... static vgui_Xm* instance_; };">
<BR></FONT>
<P>
from <TT>vgui_Xm.C</TT>
<P>
<FONT SIZE="-2">
<BR>
<IMG
WIDTH="688" HEIGHT="248" ALIGN="BOTTOM" BORDER="0"
SRC="img11.gif"
ALT="vgui\_Xm* vgui\_Xm::instance\_ = 0;... instance\_ = new vgui\_Xm; return instance\_; \}">
<BR></FONT>
<P>
The line containing vgui_Xm_instantiation causes the (sole) instance of vgui_Xm to be
created and due to the ctor vgui::vgui being called, vgui_Xm is then registered with
VGUI under the name given in the virtual function <TT>::name</TT>
e.g. <TT>string vgui_Fl::name() const { return "fltk"; } </TT>
<P>
The other important function to override is <TT>vgui::run_impl</TT>
which basically calls the main event loop for the interface e.g.
<P>
<FONT SIZE="-2">
<BR>
<IMG
WIDTH="346" HEIGHT="201" ALIGN="BOTTOM" BORDER="0"
SRC="img12.gif"
ALT="void vgui\_Xm::run\_impl() { ... }">
<BR></FONT>
The other functions to override are the factory methods returning vgui_window subclasses
of the correct type. e.g.
<P>
<FONT SIZE="-2">
<BR>
<IMG
WIDTH="927" HEIGHT="86" ALIGN="BOTTOM" BORDER="0"
SRC="img13.gif"
ALT="vgui_window* vgui_Fl::produce_window_impl()... { return new vgui_Fl_window(width, height, title); }">
<BR></FONT>
<P>
<BR><HR>
<ADDRESS>
<I>Target Junior User</I>
<BR><I>2000-10-31</I>
</ADDRESS>
</BODY>
</HTML>

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks