wxSashEvent(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

πŸ’– wxSashEvent πŸ’–

okay so bestie, welcome to the wxSashEvent page β€” straight out of the Erlang Module Definition corner of the manual, and it's lowkey one of my faves because it's all about drags. Sash drags. Slay.


✨ NAME ✨

wxSashEvent β€” a sash event gets sent when the sash of a wxSashWindow has been dragged by the user. that's it, that's the whole vibe.


🌸 DESCRIPTION 🌸

Remark: so here's the tea. when a sash belonging to a sash window gets dragged by the user and then released, this event is sent to the window. from there it can be processed by an event table entry in a derived class, a plug-in event handler, or an ancestor class. note that the wxSashWindow does not change the window's size itself β€” nope, not its job. it relies on the application's event handler to do that. why? because the application might have to handle other consequences of the resize, or it may wish to veto it altogether. main character energy, honestly.

your event handler should look at the drag rectangle: peep getDragRect/1 to see what the new size of the window would be if the resize were to be applied. it should also call getDragStatus/1 to see whether the drag was OK or out of the current allowed range. 🫢

See:

  • wxSashWindow
  • Overview events

this class is derived, and can use functions, from:

  • wxCommandEvent
  • wxEvent

wxWidgets docs: wxSashEvent

πŸ¦‹ Events πŸ¦‹

use wxEvtHandler:connect/3 with wxSashEventType to subscribe to events of this type. that's how you get on the list, bestie.


⭐ DATA TYPES ⭐

wxSash() :: #wxSash{}.
wxSashEvent() :: wx:wx_object().
wxSashEventType() :: sash_dragged.

πŸ’… FUNCTIONS πŸ’…

  • getDragRect(This)
getDragRect(This) ->
                     {X :: integer(),
                      Y :: integer(),
                      W :: integer(),
                      H :: integer()}
                     when This :: wxSashEvent().

returns the rectangle representing the new size the window would be if the resize was applied. πŸ‘‘

it is up to the application to set the window size if required β€” the library is not doing it for you, no cap.

  • getDragStatus(This)
getDragStatus(This) -> wx:wx_enum() when This :: wxSashEvent().

returns the status of the sash: one of wxSASH_STATUS_OK, wxSASH_STATUS_OUT_OF_RANGE.

if the drag caused the notional bounding box of the window to flip over, for example, the drag will be out of rage. πŸ’€ (yes, the original says "rage" β€” iconic typo, we keep it, we love it.)

  • getEdge(This)
getEdge(This) -> wx:wx_enum() when This :: wxSashEvent().

returns the dragged edge. the return value is one of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT. pick your fighter 🌈


and that's the whole page, bestie!! this lil drop of documentation was brought to you by Ericsson AB, wx 2.6, and the wxSashEvent(3) manual page itself. go forth and drag those sashes responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from