]> git.saurik.com Git - wxWidgets.git/blobdiff - docs/latex/wx/function.tex
EnableTool() should be called after Realize()
[wxWidgets.git] / docs / latex / wx / function.tex
index 3a5343e446ad6501a1a3b029bb774633bd236b2a..8e24cc3391dfa8b5a58647606b6fa915902e1f1c 100644 (file)
@@ -4,6 +4,58 @@
 
 The functions defined in wxWindows are described here.
 
+\section{Thread functions}\label{threadfunctions}
+
+\wxheading{Include files}
+
+<wx/thread.h>
+
+\wxheading{See also}
+
+\helpref{wxThread}{wxthread}, \helpref{wxMutex}{wxmutex}, \helpref{Multithreading overview}{wxthreadoverview}
+
+\membersection{::wxMutexGuiEnter}\label{wxmutexguienter}
+
+\func{void}{wxMutexGuiEnter}{\void}
+
+This function must be called when any thread other than the main GUI thread
+wants to get access to the GUI library. This function will block the execution
+of the calling thread until the main thread (or any other thread holding the
+main GUI lock) leaves the GUI library and no other other thread will enter
+the GUI library until the calling thread calls \helpref{::wxMutexGuiLeave()}{wxmutexguileave}.
+
+Typically, these functions are used like this:
+
+\begin{verbatim}
+void MyThread::Foo(void)
+{
+    // before doing any GUI calls we must ensure that this thread is the only
+    // one doing it!
+
+    wxMutexGuiEnter();
+
+    // Call GUI here:
+    my_window->DrawSomething();
+    
+    wxMutexGuiLeave();
+}
+\end{verbatim}
+
+Note that under GTK, no creation of top-level windows is allowed in any
+thread but the main one.
+
+This function is only defined on platforms which support preemptive
+threads. 
+
+\membersection{::wxMutexGuiLeave}\label{wxmutexguileave}
+
+\func{void}{wxMutexGuiLeave}{\void}
+
+See \helpref{::wxMutexGuiEnter()}{wxmutexguienter}.
+
+This function is only defined on platforms which support preemptive
+threads.
+
 \section{File functions}\label{filefunctions}
 
 \wxheading{Include files}
@@ -90,7 +142,9 @@ configuration, can be handlers for BMP (loading) (always installed), GIF
 (loading), PCX (loading), PNM (loading and saving as raw
 rgb), PNG (loading and saving), JPEG (loading and saving), file formats.
 
-See also: \helpref{wxImage}{wximage} \helpref{wxImageHandler}{wximagehandler}
+\wxheading{See also}
+
+\helpref{wxImage}{wximage}, \helpref{wxImageHandler}{wximagehandler}
 
 \membersection{::wxIsAbsolutePath}
 
@@ -258,7 +312,9 @@ Use of this function requires the file wx\_doc.h to be included.
 Returns the FQDN (fully qualified domain host name) or an empty string on
 error.
 
-See also: \helpref{wxGetHostName}{wxgethostname}
+\wxheading{See also}
+
+\helpref{wxGetHostName}{wxgethostname}
 
 \wxheading{Include files}
 
@@ -296,7 +352,9 @@ The first variant of this function returns the hostname if successful or an
 empty string otherwise. The second (deprecated) function returns TRUE
 if successful, FALSE otherwise.
 
-See also: \helpref{wxGetFullHostName}{wxgetfullhostname}
+\wxheading{See also}
+
+\helpref{wxGetFullHostName}{wxgetfullhostname}
 
 \wxheading{Include files}
 
@@ -321,7 +379,9 @@ The first variant of this function returns the login name if successful or an
 empty string otherwise. The second (deprecated) function returns TRUE
 if successful, FALSE otherwise.
 
-See also: \helpref{wxGetUserName}{wxgetusername}
+\wxheading{See also}
+
+\helpref{wxGetUserName}{wxgetusername}
 
 \wxheading{Include files}
 
@@ -344,7 +404,9 @@ The first variant of this function returns the user name if successful or an
 empty string otherwise. The second (deprecated) function returns TRUE
 if successful, FALSE otherwise.
 
-See also: \helpref{wxGetUserId}{wxgetuserid}
+\wxheading{See also}
+
+\helpref{wxGetUserId}{wxgetuserid}
 
 \wxheading{Include files}
 
@@ -427,20 +489,20 @@ buffer is never overflowed.
 Returns the number of characters copied to the buffer or -1 if there is not
 enough space.
 
-\wxheading{See also:}
-\helpref{wxVsnprintf}{wxvsnprintf},
-\helpref{wxString::Printf}{wxstringprintf}
+\wxheading{See also}
+
+\helpref{wxVsnprintf}{wxvsnprintf}, \helpref{wxString::Printf}{wxstringprintf}
 
-\membersection{::wxVsnprintf}\label{wxsnprintf}
+\membersection{::wxVsnprintf}\label{wxvsnprintf}
 
 \func{int}{wxVsnprintf}{\param{wxChar *}{buf}, \param{size\_t }{len}, \param{const wxChar *}{format}, \param{va\_list }{argptr}}
 
 The same as \helpref{wxSnprintf}{wxsnprintf} but takes a {\tt va\_list}
 argument instead of arbitrary number of parameters.
 
-\wxheading{See also:}
-\helpref{wxSnprintf}{wxsnprintf},
-\helpref{wxString::PrintfV}{wxstringprintfv}
+\wxheading{See also}
+
+\helpref{wxSnprintf}{wxsnprintf}, \helpref{wxString::PrintfV}{wxstringprintfv}
 
 \section{Dialog functions}\label{dialogfunctions}
 
@@ -462,7 +524,7 @@ used with \helpref{wxShowTip}{wxshowtip}.
 \docparam{currentTip}{The index of the first tip to show - normally this index
 is remembered between the 2 program runs.}
 
-\wxheading{See also:}
+\wxheading{See also}
 
 \helpref{Tips overview}{tipsoverview}
 
@@ -478,13 +540,13 @@ is remembered between the 2 program runs.}
  \param{int}{ x = -1}, \param{int}{ y = -1}}
 
 Pops up a file selector box. In Windows, this is the common file selector
-dialog. In X, this is a file selector box with somewhat less functionality.
+dialog. In X, this is a file selector box with the same functionality.
 The path and filename are distinct elements of a full file pathname.
 If path is empty, the current directory will be used. If filename is empty,
 no default filename will be supplied. The wildcard determines what files
 are displayed in the file selector, and file extension supplies a type
 extension for the required filename. Flags may be a combination of wxOPEN,
-wxSAVE, wxOVERWRITE\_PROMPT, wxHIDE\_READONLY, wxMULTIPLE or 0.
+wxSAVE, wxOVERWRITE\_PROMPT, wxHIDE\_READONLY, wxFILE\_MUST\_EXIST, wxMULTIPLE or 0.
 
 Both the Unix and Windows versions implement a wildcard filter. Typing a
 filename containing wildcards (*, ?) in the filename text item, and
@@ -691,7 +753,7 @@ It may be created with the \helpref{wxCreateFileTipProvider}{wxcreatefiletipprov
 otherwise. This is used as the initial value for "Show tips at startup"
 checkbox which is shown in the tips dialog.}
 
-\wxheading{See also:}
+\wxheading{See also}
 
 \helpref{Tips overview}{tipsoverview}
 
@@ -1293,7 +1355,7 @@ Under X only, returns the current display name. See also \helpref{wxSetDisplayNa
 
 Return the (current) user's home directory.
 
-\wxheading{See also:}
+\wxheading{See also}
 
 \helpref{wxGetUserHome}{wxgetuserhome}