wxXmlResource(3)
β¨ NAME β¨
wxXmlResource β bestie, this is the main character class for interacting with the XML-based resource system. Like, the whole vibe of XRC? This is it. π
π¦ DESCRIPTION π¦
Okay so, this class holds XML resources from one or more .xml files, binary files or zip archive files. All of them. It's giving resource hoarder and honestly we love her for it. β¨
Lowkey important: this is a singleton class, so you'll literally never allocate it or deallocate it yourself. Do not try. Just use the static get/0 getter and let her cook. π«Ά
See also, because the lore goes deep:
- Overview xrc
- Overview xrcformat
- wxWidgets docs: wxXmlResource
π DATA TYPES π
wxXmlResource() :: wx:wx_object().
π FUNCTIONS π
attachUnknownControl πΈ
attachUnknownControl(This, Name, Control, [Option]) -> boolean()
when
This :: wxXmlResource(),
Name :: unicode:chardata(),
Control :: wxWindow:wxWindow(),
Option ::
{parent, wxWindow:wxWindow()}.
Attaches an unknown control to the given panel/window/dialog. Bestie you're basically introducing a mystery guest to the function.
Unknown controls get used in conjunction with <object class="unknown">. iykyk. π
clearHandlers π§Ή
clearHandlers(This) -> ok when This :: wxXmlResource().
Removes all handlers and deletes them. No survivors, periodt. And heads up: this means any handlers added using AddHandler() (not implemented in wx) must be allocated on the heap. That's not a suggestion, that's the rule fr fr. π
compareVersion π₯
compareVersion(This, Major, Minor, Release, Revision) -> integer()
when
This :: wxXmlResource(),
Major :: integer(),
Minor :: integer(),
Release :: integer(),
Revision :: integer().
Compares the XRC version to the argument. It's a vibe check for versions.
Returns -1 if the XRC version is less than the argument, +1 if greater, and 0 if they are equal. β¨
destroy π₯
destroy(This :: wxXmlResource()) -> ok.
Destroys the object. Say bye bye. π
get π
get() -> wxXmlResource().
Gets the global resources object, or creates one if none exists. She's always there for you. Main character energy only. π
getFlags π©
getFlags(This) -> integer() when This :: wxXmlResource().
Returns flags, which may be a bitlist of ?wxXmlResourceFlags enumeration values.
getVersion π·οΈ
getVersion(This) -> integer() when This :: wxXmlResource().
Returns version information (a.b.c.d = d + 256*c + 2562*b + 2563*a). Math is math, bestie. π’
getXRCID π
getXRCID(Str_id, [Option]) -> integer()
when
Str_id :: unicode:chardata(),
Option :: {value_if_not_found, integer()}.
Returns a numeric ID that is equivalent to the string ID used in an XML resource. Translating names into numbers, iconic behaviour.
If an unknown str_id is requested (i.e. other than wxID_XXX or integer), a new record is created which associates the given string with a number.
If value_if_not_found is wxID_NONE, the number is obtained via wx_misc:newId/0. Otherwise value_if_not_found is used.
Macro XRCID(name) is provided for convenient use in event tables.
Note: IDs returned byXRCID()cannot be used with theEVT_*_RANGEmacros, because the order in which they are assigned to symbolic name values is not guaranteed. So likeβ¦ don't do that. The order is β¨chaoticβ¨ and not in a fun way. π
initAllHandlers π
initAllHandlers(This) -> ok when This :: wxXmlResource().
Initializes handlers for all supported controls/windows. Everything, everywhere, all at once.
This will make the executable quite big because it forces linking against most of the wxWidgets library. Big executable, big dreams, no cap. π
load π
load(This, Filemask) -> boolean()
when
This :: wxXmlResource(),
Filemask :: unicode:chardata().
Loads resources from XML files that match given filemask.
Example:
Note: IfwxUSE_FILESYSis enabled, this method understands wxFileSystem (not implemented in wx) URLs (seewxFileSystem::FindFirst()(not implemented in wx)).
Note: If you are sure that the argument is name of single XRC file (rather than an URL or a wildcard), use LoadFile() (not implemented in wx) instead. Fr fr, save yourself the confusion. π
loadBitmap πΌοΈ
loadBitmap(This, Name) -> wxBitmap:wxBitmap()
when
This :: wxXmlResource(),
Name :: unicode:chardata().
Loads a bitmap resource from a file. Cute picture unlocked β¨
loadDialog πͺ
loadDialog(This, Parent, Name) -> wxDialog:wxDialog()
when
This :: wxXmlResource(),
Parent :: wxWindow:wxWindow(),
Name :: unicode:chardata().
Loads a dialog.
parent points to parent window (if any).
loadDialog (round two, finishing an existing one) πͺβ¨
loadDialog(This, Dlg, Parent, Name) -> boolean()
when
This :: wxXmlResource(),
Dlg :: wxDialog:wxDialog(),
Parent :: wxWindow:wxWindow(),
Name :: unicode:chardata().
Loads a dialog.
parent points to parent window (if any).
This form is used to finish creation of an already existing instance (the main reason for this is that you may want to use derived class with a new event table). Example:
loadFrame πΌοΈ
loadFrame(This, Parent, Name) -> wxFrame:wxFrame()
when
This :: wxXmlResource(),
Parent :: wxWindow:wxWindow(),
Name :: unicode:chardata().
Loads a frame from the resource.
parent points to parent window (if any).
loadFrame (round two, finishing an existing one) πΌοΈβ¨
loadFrame(This, Frame, Parent, Name) -> boolean()
when
This :: wxXmlResource(),
Frame :: wxFrame:wxFrame(),
Parent :: wxWindow:wxWindow(),
Name :: unicode:chardata().
Loads the contents of a frame onto an existing wxFrame.
This form is used to finish creation of an already existing instance (the main reason for this is that you may want to use derived class with a new event table). π
loadIcon β
loadIcon(This, Name) -> wxIcon:wxIcon()
when
This :: wxXmlResource(),
Name :: unicode:chardata().
Loads an icon resource from a file.
loadMenu π
loadMenu(This, Name) -> wxMenu:wxMenu()
when
This :: wxXmlResource(),
Name :: unicode:chardata().
Loads menu from resource.
Returns NULL on failure. Not a slay, but we move. π
loadMenuBar π
loadMenuBar(This, Name) -> wxMenuBar:wxMenuBar()
when
This :: wxXmlResource(),
Name :: unicode:chardata().
loadMenuBar (with a parent) π
loadMenuBar(This, Parent, Name) -> wxMenuBar:wxMenuBar()
when
This :: wxXmlResource(),
Parent :: wxWindow:wxWindow(),
Name :: unicode:chardata().
Loads a menubar from resource.
Returns NULL on failure. π«
loadPanel π§
loadPanel(This, Parent, Name) -> wxPanel:wxPanel()
when
This :: wxXmlResource(),
Parent :: wxWindow:wxWindow(),
Name :: unicode:chardata().
Loads a panel.
parent points to the parent window.
loadPanel (round two, finishing an existing one) π§β¨
loadPanel(This, Panel, Parent, Name) -> boolean()
when
This :: wxXmlResource(),
Panel :: wxPanel:wxPanel(),
Parent :: wxWindow:wxWindow(),
Name :: unicode:chardata().
Loads a panel.
parent points to the parent window. This form is used to finish creation of an already existing instance.
loadToolBar π οΈ
loadToolBar(This, Parent, Name) -> wxToolBar:wxToolBar()
when
This :: wxXmlResource(),
Parent :: wxWindow:wxWindow(),
Name :: unicode:chardata().
Loads a toolbar. Werk. π
new π±
new([Option]) -> wxXmlResource()
when
Option ::
{flags, integer()} | {domain, unicode:chardata()}.
Constructor. Baby's first resource object π
new (with a filemask) π±π
new(Filemask, [Option]) -> wxXmlResource()
when
Filemask :: unicode:chardata(),
Option ::
{flags, integer()} | {domain, unicode:chardata()}.
Constructor. Same energy, now with a filemask bestie.
set π
set(Res) -> wxXmlResource() when Res :: wxXmlResource().
Sets the global resources object and returns a pointer to the previous one (may be NULL). Handing over the crown, but keeping receipts of the last one. π
setFlags π
setFlags(This, Flags) -> ok
when This :: wxXmlResource(), Flags :: integer().
Sets flags (bitlist of ?wxXmlResourceFlags enumeration values).
unload ποΈ
unload(This, Filename) -> boolean()
when
This :: wxXmlResource(),
Filename :: unicode:chardata().
This function unloads a resource previously loaded by load/2.
Returns true if the resource was successfully unloaded and false if it hasn't been found in the list of loaded resources. Closure, but make it conditional. β¨
And that's the whole page, bestie β every flag, every signature, every note, untouched and slaying. π
Brought to you by Ericsson AB, living in wx 2.6 era, filed under the page name wxXmlResource(3). Drink some water, go touch grass, and remember: the singleton was always yours. π¦πΈπ
π¦ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms