The functions and macros defined in wxPython are described here: you can look up a function using the alphabetical listing of them.
A | B | C | D | E | F | G | H | I | K | L | M | N | P | Q | R | S | T | U | V | W | Y
This function shows the standard about dialog containing the information specified in info. If the current platform has a native about dialog which is capable of showing all the fields in wx.AboutDialogInfo, the native dialog is used, otherwise the function falls back to the generic wxWidgets version of the dialog.
Here is an example of how this function may be used:
def ShowSimpleAboutDialog(event):
info = wx.AboutDialogInfo()
info.SetName("My Program")
info.SetVersion("1.2.3 Beta")
info.SetDescription("This program does something great.")
info.SetCopyright("(C) 2007 Me <my@email.addre.ss>")
wx.AboutBox(info)
Parameters:
Create accelerator corresponding to the specified string, or None if it coulnd’t be parsed.
Parameters:
Returns:
Remove provider. The provider must have been added previously! The provider is not deleted.
Parameters:
Returns:
bool
Query the providers for bitmap with given ID and return it.
Returns wx.NullBitmap if no provider provides it.
Parameters:
Returns:
Query the providers for icon with given ID and return it.
Returns wx.NullIcon if no provider provides it.
Parameters:
Returns:
Get the size hint of an icon from a specific Art Client, queries the topmost provider if platform_dependent is False.
Parameters:
Returns:
Add new provider to the bottom of providers stack.
Parameters:
Remove latest added provider and delete it.
Returns:
bool
Add new provider to the top of providers stack.
Parameters:
Checks if the window is natively double buffered and will return a wx.PaintDC if it is, a wx.BufferedPaintDC otherwise.
The advantage of this function over wx.AutoBufferedPaintDC is that this function will check if the the specified window has double-buffering enabled rather than just going by platform defaults.
Parameters:
Returns:
Changes the cursor to the given cursor for all windows in the application. Use wx.EndBusyCursor to revert the cursor back to its previous state. These two calls can be nested, and a counter ensures that only the outer calls take effect.
Parameters:
See also
Creates a bitmap from an array of bits.
You should only use this function for monochrome bitmaps (depth 1) in portable programs: in this case the bits parameter should contain an XBM image.
For other bit depths, the behaviour is platform dependent.
Parameters:
Returns:
Creates a wx.Bitmap from the data in dataBuffer.
The dataBuffer parameter must be a Python object that implements the buffer interface, such as a string, array, etc.
The dataBuffer object is expected to contain a series of RGB bytes and be width*height*3 bytes long. A buffer object can optionally be supplied for the image’s alpha channel data, and it is expected to be width*height bytes long.
On Windows and Mac the RGB values are ‘premultiplied’ by the alpha values. (The other platforms do the multiplication themselves.)
Unlike wx.ImageFromBuffer the bitmap created with this function does not share the memory buffer with the buffer object. This is because the native pixel buffer format varies on different platforms, and so instead an efficient as possible copy of the data is made from the buffer objects to the bitmap’s native pixel buffer.
For direct access to a bitmap’s pixel buffer see wx.NativePixelData and wx.AlphaPixelData.
Parameters:
See also
wx.Bitmap, wx.BitmapFromBufferRGBA, wx.NativePixelData, wx.AlphaPixelData, wx.ImageFromBuffer
Creates a wx.Bitmap from the data in dataBuffer.
The dataBuffer parameter must be a Python object that implements the buffer interface, such as a string, array, etc.
The dataBuffer object is expected to contain a series of RGB bytes and be width*height*3 bytes long. A buffer object can optionally be supplied for the image’s alpha channel data, and it is expected to be width*height bytes long.
On Windows and Mac the RGB values are ‘premultiplied’ by the alpha values. (The other platforms do the multiplication themselves.)
Unlike wx.ImageFromBuffer the bitmap created with this function does not share the memory buffer with the buffer object. This is because the native pixel buffer format varies on different platforms, and so instead an efficient as possible copy of the data is made from the buffer objects to the bitmap’s native pixel buffer.
For direct access to a bitmap’s pixel buffer see wx.NativePixelData and wx.AlphaPixelData.
Parameters:
Create a new bitmap from a wx.Icon object.
Parameters:
Returns:
Creates bitmap object from a wx.Image.
This has to be done to actually display a wx.Image as you cannot draw an image directly on a window. The resulting bitmap will use the provided colour depth (or that of the current screen colour depth if depth is -1) which entails that a colour reduction may have to take place.
Parameters:
Returns:
Construct a Bitmap from a list of strings formatted as XPM data.
Parameters:
Returns:
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Constructs a stippled brush using a bitmap.
Parameters:
Returns:
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Call the specified function after the current and pending event handlers have been completed.
This is also good for making GUI method calls from non-GUI threads.
Any extra positional or keyword args are passed on to the callable when it is called.
Parameters:
See also
Returns:
int
Parameters:
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Returns the dimensions of the work area on the display.
On Windows this means the area not covered by the taskbar, etc... Other platforms are currently defaulting to the whole display until a way is found to provide this info for all window managers, etc.
Returns:
(x, y, width, height)
Returns global instance (wx.TheClipboard) of the object.
Returns:
Returns True if the display is colour, False otherwise.
Returns:
bool
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Create and return a new global config object.
This function will create the “best” implementation of wx.Config available for the current platform.
Returns:
Returns the current global config object, creating one if neccessary.
Parameters:
Returns:
Sets the global config object (the one returned by Get) and returns a reference to the previous global config object.
Parameters:
Returns:
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
This function creates a wx.TipProvider which may be used with wx.ShowTip.
Parameters:
Returns:
Constructs a cursor from a wx.Image. The mask (if any) will be used for setting the transparent portions of the cursor.
Parameters:
Returns:
Constructs a data format object for a custom format identified by its name.
Parameters:
Returns:
Convenience function for converting a wx.Point or (x, y) in dialog units to pixel units.
Parameters:
Convenience function for converting a wx.Size or (w, h) in dialog units to pixel units.
Parameters:
Returns either a wx.Cursor or wx.Icon created from the image file filename. This function is useful with the wx.DropSource class which, depending on platform accepts either a icon or a cursor.
Parameters:
See wx.DateSpan.Day
Returns:
See wx.DateSpan.Days
Parameters:
Returns:
Returns:
Parameters:
Returns:
See wx.DateSpan.Week
Returns:
Parameters:
Returns:
See wx.DateSpan.Year
Returns:
Parameters:
Returns:
Creates a wx.DateTime object from a day-month-year triplet plus optional hour, minute, second and millisecond parameters.
Parameters:
Returns:
Creates a wx.DateTime object from a wx.DateTime object.
Parameters:
Returns:
Creates a wx.DateTime object from a hour-minute-second-millisecond quadruplet.
Parameters:
Returns:
Creates a wx.DateTime object from Julian Day Number.
Parameters:
Returns:
Parameters:
Returns:
See wx.DateTime.ConvertYearToBC.
Parameters:
Returns:
int
Get the AM and PM strings in the current locale (may be empty)
Returns:
(am, pm)
Parameters:
Returns:
Parameters:
Returns:
int
Returns:
int
See wx.DateTime.GetCurrentMonth.
Parameters:
Returns:
int
See wx.DateTime.GetCurrentYear.
Parameters:
Returns:
int
Parameters:
Returns:
Parameters:
Returns:
String
See wx.DateTime.GetNumberOfDaysInMonth.
Parameters:
Returns:
int
See wx.DateTime.GetNumberOfDaysInYear.
Parameters:
Returns:
int
See wx.DateTime.GetWeekDayName.
Parameters:
Returns:
String
See wx.DateTime.IsDSTApplicable.
Parameters:
Returns:
bool
Parameters:
Returns:
bool
See wx.DateTime.IsWestEuropeanCountry.
Parameters:
Returns:
bool
See wx.DateTime.Now.
Returns:
Parameters:
See wx.DateTime.SetToWeekOfYear.
Parameters:
Returns:
See wx.DateTime.Today.
Returns:
See wx.DateTime.UNow.
Returns:
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Pops up a directory selector dialog. The arguments have the same meaning as those of wx.DirDialog.__init__. The message is displayed at the top, and the defaultPath, if specified, is set as the initial selection.
The application must check for an empty return value (if the user pressed Cancel). For example:
directory = wx.DirSelector("Choose a folder")
if not directory.strip():
# User cancelled the dialog...
DoSomething()
Parameters:
Returns:
string
Returns the depth of the display (a value of 1 denotes a monochrome display).
Returns:
int
Returns the display size in pixels.
Returns:
(width, height)
Returns the display size in millimeters.
Returns:
(width, height)
Return the number of available displays.
Returns:
int
Find the display where the given point lies, return wx.NOT_FOUND if it doesn’t belong to any display
Parameters:
Returns:
int
Find the display where the given window lies, return wx.NOT_FOUND if it is not shown at all.
Parameters:
Returns:
int
Constructs a drag image from an icon and optional cursor.
Parameters:
Returns:
Constructs a drag image from the text in the given list control item, and optional cursor.
Parameters:
Returns:
Constructs a drag image from a text string and optional cursor.
Parameters:
Returns:
Constructs a drag image from the text in the given tree control item, and optional cursor.
Parameters:
Returns:
Creates a new bitmap of the given size. A depth of -1 indicates the depth of the current screen or visual. Some platforms only support 1 for monochrome and -1 for the current display depth.
Parameters:
Returns:
Returns a new empty 32-bit bitmap where every pixel has been initialized with the given RGBA values.
Parameters:
Returns:
Construct an empty image of a given size, optionally setting all pixels to black.
Parameters:
Returns:
This function enables or disables all top level windows. It is used by wx.SafeYield.
Parameters:
See wx.EncodingConverter.CanConvert.
Parameters:
Returns:
bool
See wx.EncodingConverter.GetAllEquivalents.
Parameters:
Returns:
list of strings
See wx.EncodingConverter.GetPlatformEquivalents.
Parameters:
Returns:
list of strings
See also
Launches the specified process.
If flags parameter contains wx.EXEC_ASYNC flag (the default), flow of control immediately returns. If it contains wx.EXEC_SYNC, the current application waits until the other program has terminated.
In the case of synchronous execution, the return value is the exit code of the process (which terminates by the moment the function returns) and will be -1 if the process couldn’t be started and typically 0 if the process terminated successfully. Also, while waiting for the process to terminate, wx.Execute will call wx.Yield. Because of this, by default this function disables all application windows to avoid unexpected reentrancies which could result from the users interaction with the program while the child process is running. If you are sure that it is safe to not disable the program windows, you may pass wx.EXEC_NODISABLE flag to prevent this automatic disabling from happening.
For asynchronous execution, however, the return value is the process id and zero value indicates that the command could not be executed. As an added complication, the return value of -1 in this case indicates that we didn’t launch a new process, but connected to the running one (this can only happen in case of using DDE under Windows for command execution). In particular, in this, and only this, case the calling code will not get the notification about process termination.
Under Unix the flag wx.EXEC_MAKE_GROUP_LEADER may be used to ensure that the new process is a group leader (this will create a new session if needed). Calling wx.Kill passing wx.KILL_CHILDREN will kill this process as well as all of its children (except those which have started their own session).
Parameters:
Returns:
int
Note
Currently wx.Execute can only be used from the main thread, calling this function from another thread will result in an assert failure in debug build and won’t work.
Force an exit of the application.
Exits application after calling wx.App.OnExit. Should only be used in an emergency: normally the top-level frame should be deleted (after deleting all other frames) to terminate the application. See wx.CloseEvent.
Replace environment variables ($SOMETHING) with their values. The format is $VARNAME or ${VARNAME} where VARNAME contains alphanumeric characters and ‘_’ only. ‘$’ must be escaped (‘$’) in order to be taken literally.
Parameters:
Returns:
string
A bit of a simpler way to create a wx.Font using flags instead of individual attribute settings. The value of flags can be a combination of the following:
Font Flag | |
---|---|
wx.FONTFLAG_DEFAULT | |
wx.FONTFLAG_ITALIC | |
wx.FONTFLAG_SLANT | |
wx.FONTFLAG_LIGHT | |
wx.FONTFLAG_BOLD | |
wx.FONTFLAG_ANTIALIASED | |
wx.FONTFLAG_NOT_ANTIALIASED | |
wx.FONTFLAG_UNDERLINED | |
wx.FONTFLAG_STRIKETHROUGH |
Parameters:
Returns:
See also
Creates a font using a size in pixels rather than points.
If there is platform API support for this then it is used, otherwise a font with the closest size is found using a binary search.
Parameters:
Returns:
See also
Pops up a file selector box. In Windows, this is the common file selector 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 default_path is empty, the current directory will be used. If default_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 wx.FD_OPEN, wx.FD_SAVE, wx.FD_OVERWRITE_PROMPT or wx.FD_FILE_MUST_EXIST.
Both the Unix and Windows versions implement a wildcard filter. Typing a filename containing wildcards (*, ?) in the filename text item, and clicking on Ok, will result in only those files matching the pattern being displayed.
The wildcard may be a specification for multiple types of file with a description for each, such as:
"BMP files (*.bmp)|*.bmp | GIF files (*.gif)|*.gif"
The application must check for an empty return value (the user pressed Cancel). For example:
filename = wx.FileSelector("Choose a file to open")
if filename.strip():
# work with the file
UserSelectedFile(filename)
else:
# cancelled by user
Cancelled()
Parameters:
Returns:
string
Note
Note that wx.FD_MULTIPLE can only be used with wx.FileDialog and not here as this function only returns a single file name.
Parameters:
See wx.FileSystem.FileNameToURL.
Parameters:
Returns:
string
See wx.FileSystem.RemoveHandler.
Parameters:
Returns:
See wx.FileSystem.URLToFileName.
Parameters:
Returns:
string
Parameters:
Returns:
wx.FileTypeInfo
See wx.FileType.ExpandCommand.
Parameters:
Returns:
string
Returns the window currently at point pt. Otherwise it returns None.
Parameters:
Returns:
Returns the window currently under the mouse pointer, if it belongs to this application. Otherwise it returns None.
Returns:
Find the first window in the application with the given id. If parent is None, the search will start from all top-level frames and dialog boxes; if non-None, the search will be limited to the given window hierarchy.
The search is recursive in both cases.
Parameters:
Returns:
Find a window by its label. Depending on the type of window, the label may be a window title or panel item label. If parent is None, the search will start from all top-level frames and dialog boxes; if non-None, the search will be limited to the given window hierarchy.
The search is recursive in both cases.
Parameters:
Returns:
Find a window by its name (as given in a window constructor or Create function call). If parent is None, the search will start from all top-level frames and dialog boxes; if non-None, the search will be limited to the given window hierarchy.
The search is recursive in both cases.
If no window with such name is found, wx.FindWindowByLabel is called.
Parameters:
Returns:
See wx.FontEnumerator.GetEncodings.
Returns:
PyObject
See wx.FontEnumerator.GetFacenames.
Returns:
PyObject
Convenience function that returns True if the given face name exist in the user’s system.
Parameters:
Returns:
bool
Construct a wx.Font from a wx.NativeFontInfo object.
Parameters:
Returns:
Construct a wx.Font from the string representation of a wx.NativeFontInfo object.
Parameters:
Returns:
Creates a font using a size in pixels rather than points. If there is platform API support for this then it is used, otherwise a font with the closest size is found using a binary search.
Parameters:
Returns:
See also
See wx.FontMapper.
Returns:
See wx.FontMapper.GetDefaultConfigPath.
Returns:
string
See wx.FontMapper.GetEncoding.
Parameters:
Returns:
int
See wx.FontMapper.GetEncodingDescription.
Parameters:
Returns:
string
See wx.FontMapper.GetEncodingFromName.
Parameters:
Returns:
int
See wx.FontMapper.GetEncodingName.
Parameters:
Returns:
string
See wx.FontMapper.GetSupportedEncodingsCount.
Returns:
int
See wx.FontMapper.Set.
Parameters:
Returns:
Returns the encoding used for all fonts created with an encoding of wx.FONTENCODING_DEFAULT.
Returns:
int
Sets the default font encoding.
Parameters:
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Construct a wx.GBSizerItem for a sizer
Parameters:
Returns:
Construct a wx.GBSizerItem for a spacer.
Parameters:
Returns:
Construct a wx.GBSizerItem for a window.
Parameters:
Returns:
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Returns the accelerator string in a label.
Parameters:
Returns:
Get the currently active window of this application, or None.
Implemented in MSW and GTK+ only, returns None in other ports.
Returns:
Returns battery state as one of wx.BATTERY_NORMAL_STATE, wx.BATTERY_LOW_STATE, wx.BATTERY_CRITICAL_STATE, wx.BATTERY_SHUTDOWN_STATE or wx.BATTERY_UNKNOWN_STATE.
wx.BATTERY_UNKNOWN_STATE is also the default on platforms where this feature is not implemented (currently everywhere but MS Windows).
Returns:
int
Returns the dimensions of the work area on the display. On Windows this means the area not covered by the taskbar, etc. Other platforms are currently defaulting to the whole display until a way is found to provide this info for all window managers, etc...
Returns:
Shows the colour selection dialog and returns the colour selected by user or invalid colour (use wx.Colour.IsOk to test whether a colour is valid) if the dialog was cancelled.
Parameters:
Returns:
Returns:
int
Returns:
int
Gets the current encoding that wxPython will use when it needs to convert a Python string or unicode object to or from a wxString.
Returns:
string
Returns the depth of the display (a value of 1 denotes a monochrome display).
Returns:
int
Gets the time in milliseconds since the last wx.StartTimer.
If resetTimer is true (the default), the timer is reset to zero by this call.
Warning
This function is deprecated.
Returns the user’s email address, by concatenating the values returned by wx.GetFullHostName and wx.GetUserId.
Returns:
string
Shows the font selection dialog and returns the font selected by user or invalid font (use wx.Font.IsOk to test whether a font is valid) if the dialog was cancelled.
Parameters:
Returns:
Returns the amount of free memory in bytes under environments which support it, and -1 if not supported or failed to perform measurement.
Returns:
int
Returns the FQDN (fully qualified domain host name) or an empty string on error.
Returns:
string
See also
Returns the curent user’s home directory.
Returns:
string
See also
Returns the hostname if successful or an empty string otherwise. Please note that the returned name is not fully qualified, i.e. it does not include the domain name.
Under Windows or NT, this function first looks in the environment variable SYSTEM_NAME; if this is not found, the entry HostName in the wxWidgets section of the WIN.INI file is tried.
Returns:
string
Get the state of a key (True if pressed or toggled on, False if not).
This is generally most useful getting the state of the modifier or toggle keys. On some platforms those may be the only keys that this function is able to detect.
Parameters:
Returns:
bool
Returns the number of seconds since local time 00:00:00 Jan 1st 1970.
Returns:
int
See also
Returns the number of milliseconds since local time 00:00:00 Jan 1st 1970.
Returns:
int
See also
Returns the current state of the mouse. Returns an instance of a wx.MouseState object that contains the current position of the mouse pointer in screen coordinants, as well as boolean values indicating the up/down status of the mouse buttons and the modifier keys.
Returns:
wx.MouseState
Parameters:
Returns:
wx.NativeEncodingInfo
Shows a dialog asking the user for numeric input. The dialogs title is set to caption, it contains a (possibly) multiline message above the single line prompt and the zone for entering the number.
The number entered must be in the range min ... max (both of which should be positive) and value is the initial value of it. If the user enters an invalid value or cancels the dialog, the function will return -1.
The dialog is centered on its parent unless an explicit position is given in pos.
Parameters:
Returns:
int
Returns the string containing the description of the current platform in a user-readable form.
For example, this function may return strings like Windows NT Version 4.0 or Linux 2.2.2 i386.
Returns:
string
Gets the version and the operating system ID for currently running OS.
Returns:
(platform, major, minor)
Similar to wx.GetTextFromUser but the text entered in the dialog is not shown on screen but replaced with stars. This is intended to be used for entering passwords as the function name implies.
Parameters:
Returns:
string
Returns the current system power state: online or offline.
Returns:
int
Returns the number uniquely identifying the current process in the system.
If an error occurs, 0 is returned.
Returns:
int
Pops up a dialog box containing a message, OK / Cancel buttons and a single-selection listbox.
The user may choose an item and press OK to return a string or Cancel to return the empty string. Use wx.GetSingleChoiceIndex if empty string is a valid choice and if you want to be able to detect pressing Cancel reliably.
You may pass the list of strings to choose from using choices which is an array of n strings for the listbox.
If centre is True, the message text (which may include new line characters) is centred; if False, the message is left-justified.
Parameters:
Returns:
string
As wx.GetSingleChoice but returns the index representing the selected string.
If the user pressed Cancel, -1 is returned.
Parameters:
Returns:
int
Parameters:
Returns:
string
Returns label that should be used for given id element.
Parameters:
Returns:
string
Pop up a dialog box with title set to caption, message, and a default_value. The user may type in text and press OK to return this text, or press Cancel to return the empty string.
If centre is True, the message text (which may include new line characters) is centred; if False, the message is left-justified.
Parameters:
Returns:
string
Returns the first top level parent of the given window, or in other words, the frame or dialog containing it, or None.
Parameters:
Returns:
Returns a list-like object of the the application’s top-level windows, (frames, dialogs, etc...).
Returns:
wx.WindowList
Alternative signatures:
GetTranslation(String str, String domain)
GetTranslation(String str, String strPlural, int n)
GetTranslation(String str, String strPlural, int n, String domain)
This function returns the translation of string str in the current locale.
If the string is not found in any of the loaded message catalogs, the original string is returned. In debug build, an error message is logged – this should help to find the strings which were not yet translated. If domain is specified then only that domain/catalog is searched for a matching string.
The third form is used when retrieving translation of string that has different singular and plural form in English or different plural forms in some other language. It takes two extra arguments: as above, str parameter must contain the singular form of the string to be converted and is used as the key for the search in the catalog. The strPlural parameter is the plural form (in English). The parameter n is used to determine the plural form. If no message catalog is found str is returned if n == 1, otherwise strPlural.
All versions call wx.Locale.GetString.
Parameters:
Returns:
string
Note
Note that this function is not suitable for literal strings in Unicode builds.
Returns the number of seconds since GMT 00:00:00 Jan 1st 1970.
Returns:
int
Returns the home directory for the given user. If the user is empty (default value), this function behaves like wx.GetHomeDir.
Parameters:
Returns:
string
This function returns the “user id” also known as “login name” under Unix i.e. something like “jsmith”. It uniquely identifies the current user (on this system).
Under Windows or NT, this function first looks in the environment variables USER and LOGNAME; if neither of these is found, the entry UserId in the wxWidgets section of the WIN.INI file is tried.
This function returns the login name if successful or an empty string otherwise.
Returns:
string
This function returns the full user name (something like “Mr. John Smith”).
Under Windows or NT, this function looks for the entry UserName in the wxWidgets section of the WIN.INI file. If PenWindows is running, the entry Current in the section User of the PENWIN.INI file is used.
This function returns the user name if successful or an empty string otherwise.
Returns:
string
Returns a swigified pointer to the X11 display. Returns None on other platforms.
Returns:
void
Alternative signature:
GraphicsContext_Create(wx.Window window)
Creates a wx.GraphicsContext either from a window or a DC.
Parameters:
Returns:
Creates a wx.GraphicsContext from a native context. This native context must be eg a CGContextRef for Core Graphics, a Graphics pointer for GDIPlus or a cairo_t pointer for Cairo.
Parameters:
Returns:
Note
For wxPython we still need a way to make this value usable.
Creates a wx.GraphicsContext from a native window.
Parameters:
Returns:
Note
For wxPython we still need a way to make this value usable.
Create a lightwieght context that can be used for measuring text only.
Returns:
Returns the default renderer on this platform. On OS X this is the Core Graphics (a.k.a. Quartz 2D) renderer, on MSW the GDIPlus renderer, and on GTK we currently default to the cairo renderer.
Returns:
Return the current application-wide help provider.
Returns:
Sset the current, application-wide help provider. Returns the previous one. Unlike some other classes, the help provider is not created on demand. This must be explicitly done by the application.
Parameters:
Returns:
Initializes the bundle with the icon(s) found in the file.
Parameters:
Returns:
Initializes the bundle with a single icon.
Parameters:
Returns:
Creates an icon starting from a specified location.
Parameters:
Returns:
Creates an icon starting from a list of strings containing XPM data.
Parameters:
Returns:
Returns True if it is appropriate to send idle events to this window.
This function looks at the mode used (see wx.IdleEvent.SetMode), and the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle events should be sent to this window now.
By default this will always return True because the update mode is initially wx.IDLE_PROCESS_ALL.
You can change the mode to only send idle events to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
Parameters:
Returns:
bool
Static method returning a value specifying how wxWidgets will send idle events: to all windows, or only to those which specify that they will process the events.
Returns:
int
Static method for specifying how wxWidgets will send idle events: to all windows, or only to those which specify that they will process the events.
The mode can be one of the following values:
Mode Flag | Description |
---|---|
wx.IDLE_PROCESS_ALL | Send idle events to all windows. |
wx.IDLE_PROCESS_SPECIFIED | Send idle events only to windows that have the wx.WS_EX_PROCESS_IDLE extra style flag set. |
Parameters:
Construct a wx.Image from a wx.Bitmap.
Parameters:
Returns:
Creates a wx.Image from the data in dataBuffer.
The dataBuffer parameter must be a Python object that implements the buffer interface, such as a string, array, etc...
The dataBuffer object is expected to contain a series of RGB bytes and be width*height*3 bytes long. A buffer object can optionally be supplied for the image’s alpha channel data, and it is expected to be width*height bytes long.
The wx.Image will be created with its data and alpha pointers initialized to the memory address pointed to by the buffer objects, thus saving the time needed to copy the image data from the buffer object to the wx.Image. While this has advantages, it also has the shoot-yourself-in-the-foot risks associated with sharing a C pointer between two objects.
To help alleviate the risk a reference to the data and alpha buffer objects are kept with the wx.Image, so that they won’t get deleted until after the wx.Image is deleted. However please be aware that it is not guaranteed that an object won’t move its memory buffer to a new location when it needs to resize its contents. If that happens then the wx.Image will end up referring to an invalid memory location and could cause the application to crash. Therefore care should be taken to not manipulate the objects used for the data and alpha buffers in a way that would cause them to change size.
Parameters:
Construct an Image from a buffer of RGB bytes.
Accepts either a string or a buffer object holding the data and the length of the data must be width*height*3.
Parameters:
Returns:
Construct an Image from a buffer of RGB bytes with an Alpha channel. Accepts either a string or a buffer object holding the data and the length of the data must be width*height*3 bytes, and the length of the alpha data must be width*height bytes.
Parameters:
Returns:
Loads an image from a file, using a MIME type string (such as ‘image/jpeg’) to specify image type.
Parameters:
Returns:
Loads an image from an input stream, or any readable Python file-like object.
Parameters:
Returns:
Loads an image from an input stream, or any readable Python file-like object, specifying the image format with a MIME type string.
Parameters:
Returns:
Get the key in the histogram for the given RGB values
Parameters:
Returns:
int
Adds a handler to the end of the static list of format handlers.
Parameters:
Returns True if the image handlers can read this file.
Parameters:
Returns:
bool
Returns True if the image handlers can read an image file from the data currently on the input stream, or a readable Python file-like object.
Parameters:
Returns:
bool
Returns the static list of image format handlers.
Returns:
PyObject
If the image file contains more than one image and the image handler is capable of retrieving these individually, this function will return the number of available images.
Parameters:
Returns:
int
Iterates all registered wx.ImageHandler objects, and returns a string containing file extension masks suitable for passing to file open/save dialog boxes.
Returns:
string
Converts a color in HSV color space to RGB color space.
Parameters:
Returns:
Adds a handler at the start of the static list of format handlers.
Parameters:
Converts a color in RGB color space to HSV color space.
Parameters:
Returns:
Finds the handler with the given name, and removes it. The handler is not deleted.
Parameters:
Returns:
bool
Calculate and return the intersection of r1 and r2.
Parameters:
Returns:
Returns True if between two wx.BeginBusyCursor and wx.EndBusyCursor calls.
Returns:
bool
See also
Parameters:
Returns:
bool
Returns True if the operating system the program is running under is 64 bit. The check is performed at run-time and may differ from the value available at compile-time (at compile-time you can just check if sizeof(void*)==8) since the program could be running in emulation mode or in a mixed 32/64 bit system (bi-architecture operating system).
Returns:
bool
Important
this function is not 100% reliable on some systems given the fact that there isn’t always a standard way to do a reliable check on the OS architecture.
Returns True if the current platform is little endian (instead of big endian). The check is performed at run-time.
Returns:
bool
Parameters:
Returns:
bool
Parameters:
Returns:
bool
Equivalent to the Unix kill function: send the given signal sig to the process with PID pid. The valid signal values are:
wx.SIGNONE, wx.SIGKILL and wx.SIGTERM have the same meaning under both Unix and Windows but all the other signals are equivalent to wx.SIGTERM under Windows.
Returns one of the following flags:
Kill Error Flags | Description |
---|---|
wx.KILL_OK | no error |
wx.KILL_BAD_SIGNAL | no such signal |
wx.KILL_ACCESS_DENIED | permission denied |
wx.KILL_NO_PROCESS | no such process |
wx.KILL_ERROR | another, unspecified error |
The flags parameter can be wx.KILL_NOCHILDREN (the default), or wx.KILL_CHILDREN, in which case the child processes of this process will be killed too. Note that under Unix, for wx.KILL_CHILDREN to work you should have created the process passing wx.EXEC_MAKE_GROUP_LEADER.
Parameters:
Returns:
int
Launches the user’s default browser and tells it to open the location at url.
Returns True if the application was successfully launched.
Parameters:
Returns:
bool
Note
Note that for some configurations of the running user, the application which is launched to open the given URL may be URL-dependent (e.g. a browser may be used for local URLs while another one may be used for remote URLs).
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Parameters:
Returns:
string
See wx.Locale.AddCatalogLookupPathPrefix.
Parameters:
Parameters:
See wx.Locale.FindLanguageInfo.
Parameters:
Returns:
wx.LanguageInfo
See wx.Locale.GetLanguageInfo.
Parameters:
Returns:
wx.LanguageInfo
See wx.Locale.GetLanguageName.
Parameters:
Returns:
string
See wx.Locale.GetSystemEncoding.
Returns:
int
See wx.Locale.GetSystemEncodingName.
Returns:
string
See wx.Locale.GetSystemLanguage.
Returns:
int
Parameters:
Returns:
bool
The right functions for debug output. They only do something in debug mode and expand to nothing in release mode (otherwise).
Parameters:
The functions to use for error messages, i.e. the messages that must be shown to the user.
The default processing is to pop up a message box to inform the user about it.
Parameters:
Like wx.LogError, but also terminates the program with the exit code 3.
Parameters:
See wx.LogVerbose.
Parameters:
For all normal, informational messages. They also appear in a message box by default (but it can be changed).
Parameters:
Messages logged by these functions will appear in the statusbar of the frame or of the top level application window by default (i.e. when using the second version of the functions).
If the target frame doesn’t have a statusbar, the message will be lost.
Parameters:
Messages logged by these functions will appear in the statusbar of the frame or of the top level application window by default (i.e. when using the second version of the functions).
If the target frame doesn’t have a statusbar, the message will be lost.
Parameters:
Mostly used by wxWidgets itself, but might be handy for logging errors after system call (API function) failure. It logs the specified message text as well as the last system error code.
Parameters:
As wx.LogDebug <#LogDebug>, trace functions only do something in debug build and expand to nothing in the release one. The reason for making it a separate function from it is that usually there are a lot of trace messages, so it might make sense to separate them from other debug messages.
The trace messages also usually can be separated into different categories and the second and third versions of this function only log the message if the mask which it has is currently enabled in wx.Log. This allows to selectively trace only some operations and not others by changing the value of the trace mask (possible during the run-time).
The predefined string trace masks used by wxWidgets are:
Parameters:
For verbose output. Normally, it is suppressed, but might be activated if the user wishes to know more details about the program progress (another, but possibly confusing name for the same function is wx.LogInfo).
Parameters:
For warnings - they are also normally shown to the user, but don’t interrupt the program work.
Parameters:
See wx.Log.AddTraceMask.
Parameters:
See wx.Log.EnableLogging.
Parameters:
Returns:
bool
Returns:
See wx.Log.GetLogLevel.
Returns:
int
See wx.Log.GetRepetitionCounting.
Returns:
bool
See wx.Log.GetTimestamp.
Returns:
string
See wx.Log.GetTraceMask.
Returns:
int
See wx.Log.GetTraceMasks.
Returns:
list of strings
See wx.Log.GetVerbose.
Returns:
bool
See wx.Log.IsAllowedTraceMask.
Parameters:
Returns:
bool
See wx.Log.IsEnabled.
Returns:
bool
See wx.Log.OnLog.
Parameters:
Parameters:
See wx.Log.SetLogLevel.
Parameters:
See wx.Log.SetRepetitionCounting.
Parameters:
See wx.Log.SetTimestamp.
Parameters:
See wx.Log.SetTraceMask.
Parameters:
See wx.Log.SetVerbose.
Parameters:
See wx.Log.TimeStamp.
Returns:
string
Warning
wx.MaskColour is deprecated, use wx.Mask instead.
Creates a DC that is compatible with the oldDC.
Parameters:
Returns:
Add file to the memory filesystem. The dataItem parameter can either be a wx.Bitmap, wx.Image or a string that can contain arbitrary data. If a bitmap or image is used then the imgType parameter should specify what kind of image file it should be written as, wx.BITMAP_TYPE_PNG, etc...
Parameters:
Note
Note that you must use a type value (aka image format) that wxWidgets can save (e.g. JPG, PNG, see wx.Image)!
Like MemoryFSHandler_AddFile, but lets you explicitly specify added file’s MIME type. This version should be used whenever you know the MIME type, because it makes accessing the files faster.
This function is new since wxWidgets version 2.8.5
Parameters:
Remove file from memory FS and free occupied memory.
Parameters:
Returns:
bool
Parameters:
Parameters:
Returns:
int
Parameters:
Returns:
string
Strips all accelerator characters and mnemonics from the given text. For example:
menuItem.GetLabelFromText("&Hello\tCtrl-H")
will return just "Hello".
Parameters:
Returns:
String
General purpose message dialog. style may be a bit list of the following identifiers:
Style Flag | Description |
---|---|
wx.YES_NO | Puts Yes and No buttons on the message box. May be combined with wx.CANCEL. |
wx.CANCEL | Puts a Cancel button on the message box. May only be combined with wx.YES_NO or wx.OK. |
wx.OK | Puts an Ok button on the message box. May be combined with wx.CANCEL. |
wx.ICON_EXCLAMATION | Displays an exclamation mark symbol. |
wx.ICON_HAND | Displays an error symbol. |
wx.ICON_ERROR | Displays an error symbol - the same as wx.ICON_HAND. |
wx.ICON_QUESTION | Displays a question mark symbol. |
wx.ICON_INFORMATION | Displays an information symbol. |
The return value is one of: wx.YES, wx.NO, wx.CANCEL, wx.OK.
For example:
answer = wx.MessageBox("Quit program?", "Confirm", wx.YES_NO | wx.CANCEL, main_frame)
if answer == wx.YES:
main_frame.Close()
message may contain newline characters, in which case the message will be split into separate lines, to cater for large messages.
Parameters:
Returns:
int
Sleeps for the specified number of microseconds. The microsecond resolution may not, in fact, be available on all platforms (currently only Unix platforms with nanosleep(2) may provide it) in which case this is the same as wx.MilliSleep (microseconds/1000).
Parameters:
Sleeps for the specified number of milliseconds.
Parameters:
This function returns True if either the given mimeType is exactly the same as wildcard or if it has the same category and the subtype of wildcard is ‘*’.
The comparison don by this function is case insensitive so it is not necessary to convert the strings to the same case before calling it.
Parameters:
Returns:
bool
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 thread will enter the GUI library until the calling thread calls wx.MutexGuiLeave.
Typically, these functions are used like this:
def Foo(self):
# Before doing any GUI calls we must ensure that this thread is the only
# one doing it!
wx.MutexGuiEnter()
# Call GUI here:
my_window.DrawSomething()
wx.MutexGuiLeave()
Note
Note that under GTK, no creation of top-level windows is allowed in any thread but the main one.
Note
This function is only defined on platforms which support preemptive threads.
Note
This function is only defined on platforms which support preemptive threads.
Constructs a colour object using a colour name listed in wx.TheColourDatabase.
Parameters:
Returns:
Constructs a colour object using a colour name listed in wx.TheColourDatabase.
Parameters:
Returns:
Returns:
EventType
Generates an integer identifier unique to this run of the program.
Returns:
int
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Returns a string representing the current date and time.
Returns:
string
Returns:
wx.FileTypeInfo
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Create a wx.Point2D object.
Parameters:
Returns:
Create wx.Point2D object.
Parameters:
Returns:
Send an event to a window or other wx.EvtHandler to be processed later.
Parameters:
Return resolution used in PostScript output.
Returns:
int
Set resolution (in pixels per inch) that will be used in PostScript output.
Default is 720ppi.
Parameters:
Precreate a wx.BitmapButton for 2-phase creation.
Returns:
Precreate a wx.CheckBox for 2-phase creation.
Returns:
Precreate a wx.CheckListBox for 2-phase creation.
Returns:
Precreate a wx.Choicebook control for 2-phase creation.
Returns:
Precreate a wx.CollapsiblePane for 2-phase creation.
Returns:
Precreate a wx.ColourPickerCtrl control for 2-phase creation.
Returns:
Precreate a wx.ComboBox control for 2-phase creation.
Returns:
Precreate a wx.Control control for 2-phase creation.
Returns:
Precreate a wx.DatePickerCtrl for use in 2-phase creation.
Returns:
Precreate a wx.DirFilterListCtrl control for 2-phase creation.
Returns:
Precreate a wx.DirPickerCtrl control for 2-phase creation.
Returns:
Precreate a wx.FilePickerCtrl control for 2-phase creation.
Returns:
Precreate a wx.FindReplaceDialog for 2-phase creation.
Returns:
Precreate a wx.FontPickerCtrl control for 2-phase creation.
Returns:
Precreate a wx.GenericDatePickerCtrl for use in 2-phase creation.
Returns:
Precreate a wx.GenericDirCtrl control for 2-phase creation.
Returns:
Precreate a wx.HtmlListBox control for 2-phase creation.
Returns:
Precreate a wx.HyperlinkCtrl control for 2-phase creation.
Returns:
Precreate a wx.ListBox control for 2-phase creation.
Returns:
Precreate a wx.ListCtrl control for 2-phase creation.
Returns:
Precreate a wx.ListView control for 2-phase creation.
Returns:
Precreate a wx.Listbook control for 2-phase creation.
Returns:
Precreate a wx.MDIChildFrame control for 2-phase creation.
Returns:
Precreate a wx.MDIClientWindow control for 2-phase creation.
Returns:
Precreate a wx.MDIParentFrame control for 2-phase creation.
Returns:
Precreate a wx.MiniFrame control for 2-phase creation.
Returns:
Precreate a wx.Notebook control for 2-phase creation.
Returns:
Precreate a wx.PopupTransientWindow control for 2-phase creation.
Returns:
wx.PopupTransientWindow
Precreate a wx.PopupWindow control for 2-phase creation.
Returns:
wx.PopupWindow
Precreate a wx.PyAxBaseWindow control for 2-phase creation.
Returns:
Precreate a wx.PyControl control for 2-phase creation.
Returns:
Precreate a wx.PyPanel control for 2-phase creation.
Returns:
Precreate a wx.PyScrolledWindow control for 2-phase creation.
Returns:
Precreate a wx.PyWindow control for 2-phase creation.
Returns:
Precreate a wx.RadioBox control for 2-phase creation.
Returns:
Precreate a wx.RadioButton control for 2-phase creation.
Returns:
Precreate a wx.SashLayoutWindow control for 2-phase creation.
Returns:
Precreate a wx.SashWindow control for 2-phase creation.
Returns:
Precreate a wx.ScrollBar control for 2-phase creation.
Returns:
Precreate a wx.ScrolledWindow control for 2-phase creation.
Returns:
Precreate a wx.SearchCtrl for 2-phase creation.
Returns:
Precreate a wx.SimpleHtmlListBox control for 2-phase creation.
Returns:
Precreate a wx.SingleInstanceChecker control for 2-phase creation.
Returns:
Precreate a wx.SpinButton control for 2-phase creation.
Returns:
Precreate a wx.SpinCtrl control for 2-phase creation.
Returns:
Precreate a wx.SplitterWindow for 2-phase creation.
Returns:
Precreate a wx.StaticBitmap control for 2-phase creation.
Returns:
Precreate a wx.StaticBox control for 2-phase creation.
Returns:
Precreate a wx.StaticLine control for 2-phase creation.
Returns:
Precreate a wx.StaticText control for 2-phase creation.
Returns:
Precreate a wx.StatusBar control for 2-phase creation.
Returns:
Precreate a wx.TextCtrl control for 2-phase creation.
Returns:
Precreate a wx.ToggleButton control for 2-phase creation.
Returns:
Precreate a wx.ToolBar control for 2-phase creation.
Returns:
Precreate a wx.Toolbook control for 2-phase creation.
Returns:
Precreate a wx.TreeCtrl control for 2-phase creation.
Returns:
Precreate a wx.Treebook control for 2-phase creation.
Returns:
Precreate a wx.VListBox control for 2-phase creation.
Returns:
Precreate a wx.VScrolledWindow control for 2-phase creation.
Returns:
Returns:
int
See wx.Process.Exists.
Parameters:
Returns:
bool
See wx.Process.Kill.
Parameters:
Returns:
int
See wx.Process.Open.
Parameters:
Returns:
Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if it wasn’t found at all.
Raises an exception on non-Windows platforms.
Returns:
int
Returns:
int
Returns:
int
Returns:
String
Returns:
int
Returns:
bool
Tests if it is possible to create a GUI in the current environment.
This will mean different things on the different platforms.
Returns:
bool
Returns True if we’re running the main loop, i.e. if the events can currently be dispatched.
Returns:
bool
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Reduce the colours in the source image and put the result into the destination image, setting the palette in the destination if needed. Both images may be the same, to overwrite the source image.
Parameters:
Returns:
bool
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Create a new wx.Rect object from Points representing two corners.
Parameters:
Returns:
Converts the non-transparent pixels of a bitmap into a region. Colour to be treated as transparent is specified in the transColour argument, along with an optional colour tolerance value.
Parameters:
Returns:
Creates a wx.Region from a list of points
Parameters:
Returns:
Ensures that ids subsequently generated by wx.NewId do not clash with the given id.
Parameters:
Return the currently used renderer.
Returns:
Return the default (native) implementation for this platform – this is also the one used by default but this may be changed by calling wx.RendererNative.Set in which case the return value of this method may be different from the return value of wx.RendererNative.Get.
Returns:
Return the generic implementation of the renderer. Under some platforms, this is the default renderer implementation, others have platform-specific default renderer which can be retrieved by calling wx.RendererNative.GetDefault.
Returns:
Set the renderer to use, passing None reverts to using the default renderer.
Returns the previous renderer used with Set or None.
Parameters:
Returns:
See wx.RendererVersion.IsCompatible.
Parameters:
Returns:
bool
See wx.RendererNative.DrawChoice.
Parameters:
See wx.RendererNative.DrawComboBox.
Parameters:
See wx.RendererNative.DrawRadioButton.
Parameters:
See wx.RendererNative.DrawTextCtrl.
Parameters:
This function shows a message to the user in a safe way and should be safe to call even before the application has been initialized or if it is currently in some other strange state (for example, about to crash). Under Windows this function shows a message box using a native dialog instead of wx.MessageBox (which might be unsafe to call), elsewhere it simply prints the message to the standard output using the title as prefix.
Parameters:
This function is similar to wx.Yield, except that it disables the user input to all program windows before calling wx.Yield and re-enables it again afterwards.
If win is not None, this window will remain enabled, allowing the implementation of some limited user interaction.
Returns the result of the call to wx.Yield.
Parameters:
Returns:
bool
Parameters:
Returns:
string
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Globally sets the cursor; only has an effect on Windows, Mac and GTK+. You should call this function with wx.NullCursor as parameter to restore the system cursor.
Parameters:
See also
Sets the encoding that wxPython will use when it needs to convert a Python string or unicode object to or from a wxString.
The default encoding is the value of locale.getdefaultlocale()[1] but please be aware that the default encoding within the same locale may be slightly different on different platforms.
For example, please see http://www.alanwood.net/demos/charsetdiffs.html for differences between the common latin/roman encodings.
Parameters:
Executes a command in an interactive shell window. If no command is specified, then just the shell is spawned.
Parameters:
Returns:
bool
See also
This function shows a “startup tip” to the user. The return value is the state of the ‘Show tips at startup’ checkbox.
Parameters:
Returns:
bool
This function shuts down or reboots the computer depending on the value of the flags. Please notice that doing this requires the corresponding access rights (superuser under Unix, SE_SHUTDOWN privilege under Windows NT) and that this function is only implemented under Unix and Win32.
Parameters:
Returns:
bool
Returns the default border size used by the other border methods.
Returns:
int
Constructs a wx.SizerItem for tracking a subsizer.
Parameters:
Returns:
Constructs a wx.SizerItem for tracking a spacer.
Parameters:
Returns:
Constructs a wx.SizerItem for tracking a window.
Parameters:
Returns:
Sleeps for the specified number of seconds.
Parameters:
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
See wx.Sound.Play
Parameters:
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Return the global standard paths singleton.
Returns:
See also
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Returns:
int
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Create a cursor using one of the stock cursors.
Parameters:
Returns:
Note
Note that not all stock cursors are available on all platforms.
Returns:
Strips any menu codes from in and returns the result.
By default, the functions strips both the mnemonics character (‘&’) which is used to indicate a keyboard shortkey, and the accelerators, which are used only in the menu items and are separated from the main text by the \t (TAB) character.
Parameters:
Returns:
string
Note
Notice that in most cases wx.MenuItem.GetLabelFromText or wx.Control.GetLabelText can be used instead.
Returns the error code from the last system call. This function uses errno on Unix platforms and GetLastError under Win32.
Returns:
int
See also
Returns the error message corresponding to the given system error code.
If errCode is 0 (default), the last error code (as returned by wx.SysErrorCode) is used.
See also
See wx.SystemOptions.GetOption
Parameters:
Returns:
String
See wx.SystemOptions.GetOptionInt
Parameters:
Returns:
int
See wx.SystemOptions.HasOption
Parameters:
Returns:
bool
Parameters:
Returns:
bool
See wx.SystemOptions.SetOption
Parameters:
See wx.SystemOptions.SetOptionInt
Parameters:
See wx.SystemSettings.GetColour
Parameters:
Returns:
Parameters:
Returns:
See wx.SystemSettings.GetMetric
Parameters:
Returns:
int
See wx.SystemSettings.GetScreenType
Returns:
int
See wx.SystemSettings.HasFeature
Parameters:
Returns:
bool
See wx.SystemSettings.SetScreenType
Parameters:
Parameters:
Returns:
bool
Parameters:
Returns:
Creates a new wx.TextAttr which is a merge of base and overlay. Properties defined in overlay take precedence over those in base.
Properties undefined/invalid in both are undefined in the result.
Parameters:
Returns:
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Returns True if this thread is the main one.
Returns:
bool
See wx.TimeSpan.Day
Returns:
See wx.TimeSpan.Days
Parameters:
Returns:
See wx.TimeSpan.Hour
Returns:
Parameters:
Returns:
Returns:
Parameters:
Returns:
Returns:
Parameters:
Returns:
Returns:
Parameters:
Returns:
See wx.TimeSpan.Week
Returns:
Parameters:
Returns:
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Parameters:
Parameters:
In debug mode this function generates a debugger exception meaning that the control is passed to the debugger if one is attached to the process. Otherwise the program just terminates abnormally.
In release mode this function does nothing.
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Returns True if it is appropriate to update (send UI update events to) this window.
This function looks at the mode used (see wx.UpdateUIEvent.SetMode), the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update events were last sent in idle time, and the update interval, to determine whether events should be sent to this window now.
By default this will always return true because the update mode is initially wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update events will be sent as often as possible. You can reduce the frequency that events are sent by changing the mode and/or setting an update interval.
Parameters:
Returns:
bool
Returns a value specifying how wxWidgets will send update events: to all windows, or only to those which specify that they will process the events.
Returns:
int
Returns the current interval between updates in milliseconds.
Set -1 to disable updates, 0 to update as frequently as possible.
Returns:
int
Specify how wxWidgets will send update events: to all windows, or only to those which specify that they will process the events.
mode may be one of the following values:
The default is wx.UPDATE_UI_PROCESS_ALL.
Parameters:
Sets the interval between updates in milliseconds. Set to -1 to disable updates, or to 0 to update as frequently as possible. The default is 0.
Use this to reduce the overhead of UI update events if your application has a lot of windows. If you set the value to -1 or greater than 0, you may also need to call wx.Window.UpdateWindowUI at appropriate points in your application, such as when a dialog is about to be shown.
Parameters:
Sleeps for the specified number of seconds.
Parameters:
Returns:
bool
See wx.Validator.SetBellOnError
Parameters:
Returns a string containing version and port info.
Returns:
string
This functions wakes up the (internal and platform dependent) idle system, i.e. it will force the system to send an idle event even if the system currently is idle and thus would not send any idle event until after some other event would get sent.
This is also useful for sending events between two threads and is used by the corresponding functions wx.PostEvent and wx.EvtHandler.AddPendingEvent.
Returns the window or control that currently has the keyboard focus, or None.
Returns:
Returns the window which currently captures the mouse or None.
Returns:
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user’s system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.
Parameters:
Returns:
wx.VisualAttributes
Generate a control id for the controls which were not given one.
Returns:
int
Get the id of the control following the one with the given autogenerated) winid.
Parameters:
Returns:
int
Get the id of the control preceding the one with the given autogenerated) winid.
Parameters:
Returns:
int
Yield to other apps/messages. Convenience for wx.GetApp().Yield().
Returns:
bool
Note
This function is kept only for backwards compatibility. Please use the wx.GetApp().Yield() method instead in any new code.
Yield to other apps/messages. Convenience for wx.GetApp().Yield(True).
Returns:
bool