Version: 3.3.0
msgout.h File Reference

Classes

class  wxMessageOutput
 Simple class allowing to write strings to various output channels. More...
 
class  wxMessageOutputStderr
 Output messages to stderr or another STDIO file stream. More...
 
class  wxMessageOutputBest
 Output messages in the best possible way. More...
 
class  wxMessageOutputDebug
 Output messages to the system debug output channel. More...
 
class  wxMessageOutputMessageBox
 Output messages by showing them in a message box. More...
 

Enumerations

enum  wxMessageOutputFlags {
  wxMSGOUT_PREFER_STDERR = 0 ,
  wxMSGOUT_PREFER_MSGBOX = 1
}
 Flags used with wxMessageOutputBest. More...
 

Functions

void wxSafeMessageOutput (const wxString &str)
 Check that the message output exists before using it. More...
 

Enumeration Type Documentation

◆ wxMessageOutputFlags

Flags used with wxMessageOutputBest.

See wxMessageOutputBest::wxMessageOutputBest().

Enumerator
wxMSGOUT_PREFER_STDERR 

use stderr if available (this is the default)

wxMSGOUT_PREFER_MSGBOX 

always use message box if available

Function Documentation

◆ wxSafeMessageOutput()

void wxSafeMessageOutput ( const wxString str)

Check that the message output exists before using it.

This function is equivalent to

virtual void Output(const wxString &str)=0
Method called by Printf() to really output the text.
static wxMessageOutput * Get()
Return the global message output object.

but doesn't do anything if wxMessageOutput::Get() returns nullptr, instead of crashing.

Note that typically wxMessageOutput::Get() can only ever return nullptr if wxAppTraits::CreateMessageOutput() is overridden to return nullptr, so unless your application does this, using this function is not necessary as the snippet above can be used directly.

Since
3.3.0