wxWebViewEvent(3erl)

πŸ’– wxWebViewEvent β€” Functions for wxWebViewEvent class πŸ’–

okay bestie, this is the Erlang Module Definition page for wxWebViewEvent in the 3erl manual. it's the event class that holds navigation tea for wxWebView objects, and we're gonna get into all of it. slay. ✨

🌸 NAME 🌸

wxWebViewEvent - Functions for wxWebViewEvent class.

πŸ¦‹ DESCRIPTION πŸ¦‹

a navigation event holds information about events associated with wxWebView objects. that's the whole vibe: it's the info packet for navigation-adjacent stuff in a webview. πŸ’…

  • Since: 2.9.3 β€” yes, she's been around.
  • See: wxWebView β€” the main character this event is linked to.
  • Derived from: wxNotifyEvent, wxCommandEvent, wxEvent β€” this class is derived (and can use functions) from those. lowkey a whole family tree. 🌈
  • wxWidgets docs: wxWebViewEvent β€” that's the docs name to look up.

πŸŽ€ EVENTS πŸŽ€

Use wxEvtHandler:connect/3 with wxWebViewEventType to subscribe to events of this type. that's how you get these events hooked up to your handler, no cap. 🫢

✨ DATA TYPES ✨

here's the type tea, exactly as the page serves it:

wxWebViewEvent() = wx:wx_object()

wxWebView() =
    #wxWebView{type = wxWebViewEvent:wxWebViewEventType(),
               string = unicode:chardata(),
               int = integer(),
               target = unicode:chardata(),
               url = unicode:chardata()}

wxWebViewEventType() =
    webview_navigating | webview_navigated | webview_loaded |
    webview_error | webview_newwindow | webview_title_changed

πŸ”₯ EXPORTS πŸ”₯

these are the functions you can call, with their exact signatures and type info. periodt. πŸ’…

πŸ’– getString(This) -> unicode:charlist() πŸ’–

Types:

This = wxWebViewEvent()

returns the item string for a listbox or choice selection event. if one or several items have been deselected, it returns the index of the first deselected item. and if some items have been selected and others deselected at the same time, it will return the index of the first selected item. the way that mix hits? iconic but also kinda cursed. πŸ“

πŸ’– getInt(This) -> integer() πŸ’–

Types:

This = wxWebViewEvent()

returns the integer identifier corresponding to a listbox, choice or radiobox selection (only if the event was a selection, not a deselection), or a boolean value representing the value of a checkbox.

for a menu item, this method returns -1 if the item is not checkable, or a boolean value (true or false) for checkable items indicating the new state of the item. very "it depends" of it, but that's the exact tea. β˜•

πŸ’– getTarget(This) -> unicode:charlist() πŸ’–

Types:

This = wxWebViewEvent()

gets the name of the target frame which the url of this event has been or will be loaded into. this may return an empty string if the frame is not available β€” so don't panic if it's giving blank, bestie. πŸ¦‹

πŸ’– getURL(This) -> unicode:charlist() πŸ’–

Types:

This = wxWebViewEvent()

returns the URL being visited. that's it, that's the whole vibe. 🌐


πŸ’– cute sign-off time: source/version is wxWidgets team + wx 2.2.2.1; this footer isn't giving a date, but the wxWebViewEvent(3erl) page is complete. mwah πŸ’‹

πŸ“¦ where this page comes from