R/l_isLoonWidget.R

Defines functions l_isLoonWidget

Documented in l_isLoonWidget

#' @title Check if a widget path is a valid loon widget
#'
#' @description This function can be useful to check whether a loon widget is
#'   has been closed by the user.
#'
#' @template param_widget
#'
#' @return boolean, TRUE if the argument is a valid loon widget path, FALSE
#'   otherwise
#'
#' @export
l_isLoonWidget <- function(widget) {

    if(is.null(widget)) return(FALSE)
    if(is.list(widget)) return(FALSE)

    as.logical(as.character(tcl('::loon::isKnownWidget', widget)))
}

Try the loon package in your browser

Any scripts or data that you put into this service are public.

loon documentation built on July 9, 2023, 5:48 p.m.