wxFrame(3erl)

๐Ÿ“ฆ
version 25.3.2.8 ยท 5 versions
, in ubuntu noble

๐Ÿ’… wxFrame (3erl) โ€” Erlang Module Definition ๐Ÿ’…

okay so this is the whole manual for wxFrame, and it's giving โ€œthe window that holds your whole app togetherโ€ energy. Bestie, buckle up. โœจ

๐ŸŒธ NAME ๐ŸŒธ

wxFrame โ€” functions for the wxFrame class. periodt. ๐Ÿ’–

โœจ DESCRIPTION โœจ

okay so a frame is a window whose size and position can (usually) be changed by the user. It's the main-character window vibe. ๐ŸชŸโœจ

It usually has thick borders and a title bar, and it can optionally contain a menu bar, toolbar, and status bar. A frame can contain any window that is not a frame or dialog.

A frame that has a status bar and toolbar โ€” created via createStatusBar/2 and createToolBar/2 โ€” manages these windows and adjusts the value returned by wxWindow:getClientSize/1 to reflect the remaining size available to application windows. That's the frame doing admin work, fr fr.

Remark: an application should normally define a wxCloseEvent handler for the frame to respond to system close events, for example so that related data and subwindows can be cleaned up. Do not skip this, bestie. ๐Ÿ˜ญ

๐ŸŽ€ Default event processing ๐ŸŽ€

wxFrame processes the following events:

(the source lists no events under this heading โ€” just keeping it 100% real with you. ๐Ÿ’€)

๐ŸŒˆ Styles ๐ŸŒˆ

This class supports the following styles:

See also the overview_windowstyles.

๐Ÿฆ‹ Extra Styles ๐Ÿฆ‹

This class supports the following extra styles:

See: wxMDIParentFrame, wxMDIChildFrame, wxMiniFrame, wxDialog.

This class is derived (and can use functions) from: wxTopLevelWindow wxWindow wxEvtHandler.

wxWidgets docs: wxFrame.

๐Ÿ’ซ EVENTS ๐Ÿ’ซ

Event types emitted from this class: close_window, iconize, menu_open, menu_close, menu_highlight. Slay. ๐ŸŒŸ

๐Ÿงš DATA TYPES ๐Ÿงš

wxFrame() = wx:wx_object()

That's the type, iconic. ๐Ÿ‘‘

๐Ÿ‘‘ EXPORTS ๐Ÿ‘‘

โญ new()

new() -> wxFrame()

Default constructor. no cap. ๐Ÿฃ

โญ new/3

new(Parent, Id, Title) -> wxFrame()

Types:

Parent = wxWindow:wxWindow()
Id = integer()
Title = unicode:chardata()

โญ new/4

new(Parent, Id, Title, Options :: [Option]) -> wxFrame()

Types:

Parent = wxWindow:wxWindow()
Id = integer()
Title = unicode:chardata()
Option =
    {pos, {X :: integer(), Y :: integer()}} |
    {size, {W :: integer(), H :: integer()}} |
    {style, integer()}

Constructor, creating the window. Bestie, this is where the frame gets born. ๐Ÿฃ

Remark: For Motif, MWM (the Motif Window Manager) should be running for any window styles to work (otherwise all styles take effect). That's the caveat, not me being dramatic.

See: create/5.

โญ destroy/1

destroy(This :: wxFrame()) -> ok

Destructor. Destroys all child windows and menu bar if present. It's the cleanup era. ๐Ÿงน

See overview_windowdeletion for more info.

โญ create/4

create(This, Parent, Id, Title) -> boolean()

Types:

This = wxFrame()
Parent = wxWindow:wxWindow()
Id = integer()
Title = unicode:chardata()

โญ create/5

create(This, Parent, Id, Title, Options :: [Option]) -> boolean()

Types:

This = wxFrame()
Parent = wxWindow:wxWindow()
Id = integer()
Title = unicode:chardata()
Option =
    {pos, {X :: integer(), Y :: integer()}} |
    {size, {W :: integer(), H :: integer()}} |
    {style, integer()}

Used in two-step frame construction. See new/4 for further details.

โญ createStatusBar/1

createStatusBar(This) -> wxStatusBar:wxStatusBar()

Types:

This = wxFrame()

โญ createStatusBar/2

createStatusBar(This, Options :: [Option]) ->
                   wxStatusBar:wxStatusBar()

Types:

This = wxFrame()
Option =
    {number, integer()} | {style, integer()} | {id, integer()}

Creates a status bar at the bottom of the frame. Cute.

Return: a pointer to the status bar if it was created successfully, NULL otherwise.

Remark: the width of the status bar is the whole width of the frame (adjusted automatically when resizing), and the height and text size are chosen by the host windowing system.

See: setStatusText/3, OnCreateStatusBar() (not implemented in wx), getStatusBar/1.

โญ createToolBar/1

createToolBar(This) -> wxToolBar:wxToolBar()

Types:

This = wxFrame()

โญ createToolBar/2

createToolBar(This, Options :: [Option]) -> wxToolBar:wxToolBar()

Types:

This = wxFrame()
Option = {style, integer()} | {id, integer()}

Creates a toolbar at the top or left of the frame.

Return: a pointer to the toolbar if it was created successfully, NULL otherwise.

Remark: by default, the toolbar is an instance of wxToolBar. To use a different class, override OnCreateToolBar() (not implemented in wx). When a toolbar has been created with this function, or made known to the frame with setToolBar/2, the frame will manage the toolbar position and adjust the return value from wxWindow:getClientSize/1 to reflect the available space for application windows. Under Pocket PC, you should always use this function for creating the toolbar to be managed by the frame, so that wxWidgets can use a combined menubar and toolbar. Where you manage your own toolbars, create a wxToolBar as usual.

See: createStatusBar/2, OnCreateToolBar() (not implemented in wx), setToolBar/2, getToolBar/1.

โญ getClientAreaOrigin/1

getClientAreaOrigin(This) -> {X :: integer(), Y :: integer()}

Types:

This = wxFrame()

Returns the origin of the frame client area (in client coordinates). It may be different from (0, 0) if the frame has a toolbar. Lowkey important.

โญ getMenuBar/1

getMenuBar(This) -> wxMenuBar:wxMenuBar()

Types:

This = wxFrame()

Returns a pointer to the menubar currently associated with the frame (if any).

See: setMenuBar/2, wxMenuBar, wxMenu.

โญ getStatusBar/1

getStatusBar(This) -> wxStatusBar:wxStatusBar()

Types:

This = wxFrame()

Returns a pointer to the status bar currently associated with the frame (if any).

See: createStatusBar/2, wxStatusBar.

โญ getStatusBarPane/1

getStatusBarPane(This) -> integer()

Types:

This = wxFrame()

Returns the status bar pane used to display menu and toolbar help.

See: setStatusBarPane/2.

โญ getToolBar/1

getToolBar(This) -> wxToolBar:wxToolBar()

Types:

This = wxFrame()

Returns a pointer to the toolbar currently associated with the frame (if any).

See: createToolBar/2, wxToolBar, setToolBar/2.

โญ processCommand/2

processCommand(This, Id) -> boolean()

Types:

This = wxFrame()
Id = integer()

Simulate a menu command. That's the function. โœจ

โญ sendSizeEvent/1

sendSizeEvent(This) -> ok

Types:

This = wxFrame()

โญ sendSizeEvent/2

sendSizeEvent(This, Options :: [Option]) -> ok

Types:

This = wxFrame()
Option = {flags, integer()}

This function sends a dummy wxSizeEvent to the window allowing it to re-layout its children positions. It is sometimes useful to call this function after adding or deleting a child after frame creation, or if a child size changes. Note that if the frame is using either sizers or constraints for the children layout, it is enough to call wxWindow:layout/1 directly and this function should not be used in this case. That's a real caveat, bestie.

If flags includes the wxSEND_EVENT_POST value, this function posts the event, i.e. schedules it for later processing, instead of dispatching it directly. You can also use PostSizeEvent() (not implemented in wx) as a more readable equivalent of calling this function with this flag. Cute.

โญ setMenuBar/2

setMenuBar(This, MenuBar) -> ok

Types:

This = wxFrame()
MenuBar = wxMenuBar:wxMenuBar()

Tells the frame to show the given menu bar. ๐Ÿ’…

Remark: if the frame is destroyed, the menu bar and its menus will be destroyed also, so do not delete the menu bar explicitly (except by resetting the frame's menu bar to another frame or NULL). Under Windows, a size event is generated, so be sure to initialize data members properly before calling setMenuBar/2. Note that on some platforms, it is not possible to call this function twice for the same frame object. This is important, no cap.

See: getMenuBar/1, wxMenuBar, wxMenu.

โญ setStatusBar/2

setStatusBar(This, StatusBar) -> ok

Types:

This = wxFrame()
StatusBar = wxStatusBar:wxStatusBar()

Associates a status bar with the frame. If statusBar is NULL, then the status bar, if present, is detached from the frame, but not deleted. It's giving โ€œwe're not breaking up, just taking space.โ€ ๐Ÿ™ˆ

See: createStatusBar/2, wxStatusBar, getStatusBar/1.

โญ setStatusBarPane/2

setStatusBarPane(This, N) -> ok

Types:

This = wxFrame()
N = integer()

Set the status bar pane used to display menu and toolbar help. Using -1 disables help display. periodt.

โญ setStatusText/2

setStatusText(This, Text) -> ok

Types:

This = wxFrame()
Text = unicode:chardata()

โญ setStatusText/3

setStatusText(This, Text, Options :: [Option]) -> ok

Types:

This = wxFrame()
Text = unicode:chardata()
Option = {number, integer()}

Sets the status bar text and updates the status bar display. This is a simple wrapper for wxStatusBar:setStatusText/3 which doesn't do anything if the frame has no status bar, i.e. getStatusBar/1 returns NULL. So safe.

Remark: use an empty string to clear the status bar.

See: createStatusBar/2, wxStatusBar.

โญ setStatusWidths/2

setStatusWidths(This, Widths_field) -> ok

Types:

This = wxFrame()
Widths_field = [integer()]

Sets the widths of the fields in the status bar.

Remark: the widths of the variable fields are calculated from the total width of all fields, minus the sum of widths of the non-variable fields, divided by the number of variable fields. Math era. ๐Ÿงฎ

โญ setToolBar/2

setToolBar(This, ToolBar) -> ok

Types:

This = wxFrame()
ToolBar = wxToolBar:wxToolBar()

Associates a toolbar with the frame. Short and iconic.


later, bestie ๐Ÿ’… โ€” from the wxWidgets team, version wx 2.2.2.1, on the wxFrame(3erl) page ๐Ÿซถ (the footer doesn't print a date, so no fake date from me).

๐Ÿ“ฆ where this page comes from