31 lines
1.8 KiB
HTML
31 lines
1.8 KiB
HTML
<HEAD>
|
|
<TITLE> Declaring Public Methods<A NAME=631> </A></TITLE>
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff" TEXT="#000000" LINK="#0000ff" VLINK="#000080">
|
|
<FONT FACE="Tahoma, Arial, Helvetica">
|
|
<HR> <A NAME=tex2html1196 HREF=subsection3_8_4.html><IMG ALIGN=MIDDLE SRC="../gif/icons/next_motif.gif"></A> <A NAME=tex2html1194 HREF=subsection3_8_3.html><IMG ALIGN=MIDDLE SRC="../gif/icons/up_motif.gif"></A> <A NAME=tex2html1190 HREF=subsection3_8_3.html><IMG ALIGN=MIDDLE SRC="../gif/icons/previous_motif.gif"></A> <A NAME=tex2html1198 HREF=tableofcontents3_1.html><IMG ALIGN=MIDDLE SRC="../gif/icons/contents_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A NAME=tex2html1197 HREF=subsection3_8_4.html> Standard Initialization Methods</A>
|
|
<B>Up:</B> <A NAME=tex2html1195 HREF=subsection3_8_3.html> Writing Methods</A>
|
|
<B> Previous:</B> <A NAME=tex2html1191 HREF=subsection3_8_3.html> Writing Methods</A>
|
|
<HR> <P>
|
|
<A NAME=Contents> </A><H3><A NAME=SECTION00083100000000000000> Declaring Public Methods<A NAME=631> </A></A></H3>
|
|
<P>
|
|
All the methods of a class are by default private methods and cannot
|
|
be accessed by the application programmer. If you want to make a
|
|
method public, you can include its name in the <tt>-method</tt> section
|
|
of the class declaration. In our TixArrowButton example, we have
|
|
declared that the methods <tt>flash</tt>, <tt>invert</tt> and <tt>invoke</tt>
|
|
are public methods and they can be accessed by the application
|
|
programmer. All other methods of the TixArrowButton class will be
|
|
private.
|
|
Usually, the names of private methods start with a capital letter
|
|
with individual words capitalized. The names of public methods
|
|
start with a lowercase letter.
|
|
<P>
|
|
<HR>
|
|
|
|
</FONT>
|
|
</BODY>
|
|
<P><ADDRESS>
|
|
<A HREF=http://tix.sourceforge.net>http://tix.sourceforge.net</A><BR>
|
|
</ADDRESS> |