Class: Wx::AppTraits
- Inherits:
-
Object
- Object
- Wx::AppTraits
- 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
Instance Method Summary collapse
-
#get_assert_stack_trace ⇒ String
(also: #assert_stack_trace)
Helper function mostly useful for derived classes #show_assert_dialog implementation.
-
#get_desktop_environment ⇒ String
(also: #desktop_environment)
Returns the name of the desktop environment currently running on a Unix desktop.
-
#get_standard_paths ⇒ Wx::StandardPaths
(also: #standard_paths)
Returns the StandardPaths object for the application.
-
#get_toolkit_version ⇒ Array(Wx::PortId,Integer,Integer,Integer)
(also: #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.
-
#is_using_universal_widgets ⇒ Boolean
(also: #using_universal_widgets?)
Returns true if the library was built as Universal.
-
#safe_message_box(text, title) ⇒ Boolean
Shows a message box with the given text and title if possible.
-
#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.
Instance Method Details
#get_assert_stack_trace ⇒ String 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.
81 |
# File 'lib/wx/doc/gen/app_traits.rb', line 81 def get_assert_stack_trace; end |
#get_desktop_environment ⇒ String 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.
25 |
# File 'lib/wx/doc/gen/app_traits.rb', line 25 def get_desktop_environment; end |
#get_standard_paths ⇒ Wx::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.
The returned reference is to a StandardPathsBase class but you can consider it to be equivalent to StandardPaths (which is documented).
38 |
# File 'lib/wx/doc/gen/app_traits.rb', line 38 def get_standard_paths; end |
#get_toolkit_version ⇒ Array(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.
47 |
# File 'lib/wx/doc/gen/app_traits.rb', line 47 def get_toolkit_version; end |
#is_using_universal_widgets ⇒ Boolean Also known as: using_universal_widgets?
Returns true if the library was built as Universal.
Always returns false for Base-only apps.
54 |
# File 'lib/wx/doc/gen/app_traits.rb', line 54 def ; 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.
73 |
# File 'lib/wx/doc/gen/app_traits.rb', line 73 def (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.
62 |
# File 'lib/wx/doc/gen/app_traits.rb', line 62 def show_assert_dialog(msg) end |