wxSplitterEvent(3)

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

πŸ’– NAME πŸ’–

ok so wxSplitterEvent β€” this class is literally the events that a splitter control generates. that's the whole vibe. it's the Erlang module definition for it btw, in case the file name wxSplitterEvent(3) didn't give it away πŸ¦‹


🌸 DESCRIPTION 🌸

bestie listen. there's only one event class here, but the data attached to the different events is not the same. so no, you cannot just call every accessor function on every event. that's not the move. πŸ™…β™€οΈ

the docs will tell you which kind of event(s) a given accessor function actually makes sense for. and if you call it for a different type of event? assert failure (in debug mode, so it's LOUD about it) and it'll hand you back meaningless results. not a cute look. πŸ’€

See also:

  • wxSplitterWindow
  • Overview events

this class is derived from β€” and can use functions from β€” these:

  • wxNotifyEvent
  • wxCommandEvent
  • wxEvent

wxWidgets docs: wxSplitterEvent

πŸŽ€ Events πŸŽ€

use wxEvtHandler:connect/3 with wxSplitterEventType to subscribe to events of this type. that's the plug. πŸ”Œ


✨ DATA TYPES ✨

  • wxSplitter() :: #wxSplitter{}.
  • wxSplitterEvent() :: wx:wx_object().
  • wxSplitterEventType() ::
command_splitter_sash_pos_changed |
command_splitter_sash_pos_changing |
command_splitter_doubleclicked | command_splitter_unsplit.

πŸ‘‘ FUNCTIONS πŸ‘‘

getSashPosition(This) -> integer() when This :: wxSplitterEvent().

returns the new sash position. iconic.

⚠️ may only be called while processing wxEVT_SPLITTER_SASH_POS_CHANGING and wxEVT_SPLITTER_SASH_POS_CHANGED events. any other time and it's giving chaos.

getWindowBeingRemoved(This) -> wxWindow:wxWindow() when This :: wxSplitterEvent().

returns a pointer to the window being removed when a splitter window is unsplit. it's the farewell tour. 😭

⚠️ may only be called while processing wxEVT_SPLITTER_UNSPLIT events.

getX(This) -> integer() when This :: wxSplitterEvent().

returns the x coordinate of the double-click point. where the double-click happened, horizontally. πŸ“

⚠️ may only be called while processing wxEVT_SPLITTER_DOUBLECLICKED events.

getY(This) -> integer() when This :: wxSplitterEvent().

returns the y coordinate of the double-click point. same energy, but vertical. πŸ’…

⚠️ may only be called while processing wxEVT_SPLITTER_DOUBLECLICKED events.

setSashPosition(This, Pos) -> ok when This :: wxSplitterEvent(), Pos :: integer().

ok so this one's doing a lil double duty depending on the event, keep up:

  • in the case of wxEVT_SPLITTER_SASH_POS_CHANGED events, it sets the new sash position. simple. ate.
  • in the case of wxEVT_SPLITTER_SASH_POS_CHANGING events, it sets the new tracking bar position so the visual feedback during dragging actually represents the change that will really take place. yes queen, show them what they're gonna get. ✨
  • set it to -1 from the event handler code to prevent repositioning. that's your escape hatch if you don't want the move to go through. πŸ›‘
⚠️ may only be called while processing wxEVT_SPLITTER_SASH_POS_CHANGING and wxEVT_SPLITTER_SASH_POS_CHANGED events.

Ericsson AB Β· wx 2.6 β€” that's the source and version and date right there at the footer bestie, mwah, signing off, go read wxSplitterWindow(3) next, ily, bye πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from