Class: Wx::AppTraits

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/doc/gen/app_traits.rb

Overview

The AppTraits class defines various configurable aspects of a App.

You can access it using Wx::App#get_traits function and you can create your own AppTraits overriding the Wx::App#create_traits function. Note that AppTraits is an abstract class since it contains many pure virtual functions. In fact, by default, wxWidgets creates a ConsoleAppTraits object for console applications (i.e. those applications linked against Base library only - see the Library List page) and a GUIAppTraits object for GUI applications. Both these classes are derived by AppTraits and represent concrete implementation of the AppTraits interface.

Category: Application and System configuration

See Also:

Instance Method Summary collapse

Instance Method Details

#get_assert_stack_traceString Also known as: assert_stack_trace

Helper function mostly useful for derived classes #show_assert_dialog implementation.

Returns the stack frame as a plain (and possibly empty) String. This function is only available when Setup::USE_STACKWALKER is 1.

Returns:

  • (String)

Requires:

  • USE_STACKWALKER


81
# File 'lib/wx/doc/gen/app_traits.rb', line 81

def get_assert_stack_trace; end

#get_desktop_environmentString Also known as: desktop_environment

Returns the name of the desktop environment currently running on a Unix desktop.

It returns an empty string for platforms other than WXGTK, or if the desktop environment could not be determined.

Returns:

  • (String)


25
# File 'lib/wx/doc/gen/app_traits.rb', line 25

def get_desktop_environment; end

#get_standard_pathsWx::StandardPaths Also known as: standard_paths

Returns the StandardPaths object for the application.

It’s normally the same for Base and GUI except in the case of WXOSX and Cocoa.

Note:

The returned reference is to a StandardPathsBase class but you can consider it to be equivalent to StandardPaths (which is documented).

Returns:



38
# File 'lib/wx/doc/gen/app_traits.rb', line 38

def get_standard_paths; end

#get_toolkit_versionArray(Wx::PortId,Integer,Integer,Integer) Also known as: toolkit_version

Returns the wxWidgets port ID used by the running program and eventually fills the given pointers with the values of the major, minor, and micro digits of the native toolkit currently used.

The version numbers returned are thus detected at run-time and not compile-time (except when this is not possible e.g. Motif). E.g. if your program is using WXGTK port this function will return PortId::PORT_GTK and put in given pointers the versions of the GTK library in use. See PlatformInfo for more details. If a micro version is not available it will have a value of 0.

Returns:



47
# File 'lib/wx/doc/gen/app_traits.rb', line 47

def get_toolkit_version; end

#is_using_universal_widgetsBoolean Also known as: using_universal_widgets?

Returns true if the library was built as Universal.

Always returns false for Base-only apps.

Returns:

  • (Boolean)


54
# File 'lib/wx/doc/gen/app_traits.rb', line 54

def is_using_universal_widgets; end

#safe_message_box(text, title) ⇒ Boolean

Shows a message box with the given text and title if possible.

In some ports, e.g. WXMSW, a message box will always be shown, while in the other ones it will be only done if the GUI is available (e.g. X11 display was successfully opened for X11-based ports) and the function simply returns false without doing anything otherwise. This function is safe in the sense that it can always be called, even before creating Wx::App, similarly to safe_show_message which is implemented by calling this function and then logging the message to standard error stream if it returned false.

true if the message box was shown or false otherwise.

Parameters:

  • text (String)

    The text to show to the user.

  • title (String)

    The title of the message box shown to the user.

Returns:

  • (Boolean)


73
# File 'lib/wx/doc/gen/app_traits.rb', line 73

def safe_message_box(text, title) end

#show_assert_dialog(msg) ⇒ Boolean

Shows the assert dialog with the specified message in GUI mode or just prints the string to stderr in console mode.

Returns true to suppress subsequent asserts, false to continue as before.

Parameters:

  • msg (String)

Returns:

  • (Boolean)


62
# File 'lib/wx/doc/gen/app_traits.rb', line 62

def show_assert_dialog(msg) end