wxDisplay(3)
π NAME π
wxDisplay β bestie, this is the module that determines the sizes and locations of displays connected to the system. It's the friend who knows where every single monitor is, how big it is, and which one you're actually looking at. π
β¨ DESCRIPTION β¨
It's the Erlang wrapper situation for the wxWidgets docs: wxDisplay. That's the whole description, she's lowkey mysterious. π¦
π DATA TYPES π
wxDisplay()β defined aswx:wx_object(). That's it, that's the type. π
π₯ FUNCTIONS π₯
destroy(This :: wxDisplay()) -> ok.
Destroys the object. Bye bestie, the display object is gone, no cap. π
destroy(This :: wxDisplay()) -> ok.
getClientArea(This)
Returns the client area of the display. π«Ά
The client area is the part of the display available for the normal (non full screen) windows, and usually it's the same as getGeometry/1 β but highkey it could be less if there's a taskbar (or an equivalent situation) on this display. So don't be shocked when they don't match, it's giving taskbar energy. π
getClientArea(This) ->
{X :: integer(),
Y :: integer(),
W :: integer(),
H :: integer()}
when This :: wxDisplay().
getCount() -> integer().
Returns the number of connected displays. Like, how many screens are we working with, fr fr. π
getCount() -> integer().
getFromPoint(Pt) -> integer()
Returns the index of the display on which the given point lies, or wxNOT_FOUND if the point is not on any connected display. So if your point is just floating in the void, bestie, you get wxNOT_FOUND. π
getFromPoint(Pt) -> integer()
when Pt :: {X :: integer(), Y :: integer()}.
getFromWindow(Win) -> integer()
Returns the index of the display on which the given window lies. πͺ
If the window is on more than one display, it gets the display that overlaps the window the most β majority rules, periodt.
And ngl, it returns wxNOT_FOUND if the window is not on any connected display. π
getFromWindow(Win) -> integer() when Win :: wxWindow:wxWindow().
getGeometry(This)
Returns the bounding rectangle of the display whose index was passed to the constructor. π
See:
getClientArea/1wx_misc:displaySize/0
getGeometry(This) ->
{X :: integer(),
Y :: integer(),
W :: integer(),
H :: integer()}
when This :: wxDisplay().
getName(This) -> unicode:charlist()
Returns the display's name. π·οΈ
Heads up though: the returned value is currently an empty string under all platforms except MSW. So if you're not on MSW, don't come crying to me about the empty string, she warned you. β¨
getName(This) -> unicode:charlist() when This :: wxDisplay().
getPPI(This) -> {W :: integer(), H :: integer()}
Returns display resolution in pixels per inch. The horizontal and vertical resolution are returned in the x and y components of the {Width,Height} object respectively. π§
If the resolution information is not available, returns. Yeah, that's the whole sentence. π
Since: 3.1.2 β vintage-ish, iconic.
getPPI(This) -> {W :: integer(), H :: integer()}
when This :: wxDisplay().
isOk(This) -> boolean()
Returns true if the object was initialized successfully. Vibe check: passed? β
isOk(This) -> boolean() when This :: wxDisplay().
isPrimary(This) -> boolean()
Returns true if the display is the primary display. π
The primary display is the one whose index is 0 β index zero has main character energy, that's just the rules. β
isPrimary(This) -> boolean() when This :: wxDisplay().
new() -> wxDisplay().
Default constructor creating a wxDisplay object representing the primary display. No arguments, no stress, you just get the primary one. π
new() -> wxDisplay().
new(Index) / new(Window)
Constructor creating the display object associated with the given window. πΈ
This is literally the most convenient way of finding the display on which the given window is shown, while falling back to the default display if it is not shown at all or positioned outside of any display. So it won't leave you hanging. π«Ά
See: getFromWindow/1
Since: 3.1.2 β¨
new(Index) -> wxDisplay() when Index :: integer();
(Window) -> wxDisplay() when Window :: wxWindow:wxWindow().
Okay so real talk: if you're passing anIndex, it's aninteger(). If you're passing aWindow, it's awxWindow:wxWindow(). Different clauses, same function name. Keep them straight bestie, iykyk. π
That's the whole page! Brought to you by Ericsson AB, from the wx 2.6 era of the Erlang docs. Slay, go find your displays. π¦ππ
π¦ 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