def fl_insert_nmenu_items2(ptr_flobject, ptr_flpopupentry, ptr_flpopupitem):
    """fl_insert_nmenu_items2(ptr_flobject, ptr_flpopupentry, ptr_flpopupitem)
    -> ptr_flpopupentry

    Inserts items in a nmenu flobject (alternative).

    Parameters
    ----------
        ptr_flobject : pointer to xfdata.FL_OBJECT
            nmenu flobject
        ptr_flpopupentry : pointer to xfdata.FL_POPUP_ENTRY
            existing popup entry, after which the new items are to be
            inserted. If it is None, it inserts items at the real start.
        ptr_flpopupitem : pointer to xfdata.FL_POPUP_ITEM
            popup item to be set. It can be prepared passing a dict (whose
            keys are corresponding to xfdata.FL_POPUP_ITEM's members) to
            xfstruct.fls_make_ptr_flpopupitem function.

    Returns
    -------
        ptr_flpopupentry : pointer to xfdata.FL_POPUP_ENTRY
             first nmenu item, or None (on failure)

    Examples
    --------
        >>> *todo*

    Notes
    -----
        Status: NA-UTest + Doc + Demo = OK

    """
    _fl_insert_nmenu_items2 = library.cfuncproto(
        library.load_so_libforms(), "fl_insert_nmenu_items2",
        cty.POINTER(xfdata.FL_POPUP_ENTRY), [cty.POINTER(xfdata.FL_OBJECT),
        cty.c_void_p, cty.POINTER(xfdata.FL_POPUP_ITEM)],
        """FL_POPUP_ENTRY * fl_insert_nmenu_items2(FL_OBJECT * obj,
           FL_POPUP_ITEM * p2, FL_POPUP_ITEM * p3)""")
    library.check_if_flinitialized()
    library.verify_flobjectptr_type(ptr_flobject)
    if not ptr_flpopupentry:        # it is None
        ptr_flpopupentry_alt = cty.cast(ptr_flpopupentry, \
                cty.POINTER(cty.c_void_p))
    else:                           # real FL_POPUP_ENTRY pointer
        ptr_flpopupentry_alt = ptr_flpopupentry
        library.verify_flpopupentryptr_type(ptr_flpopupentry_alt)
    library.verify_flpopupitemptr_type(ptr_flpopupitem)
    library.keep_elem_refs(ptr_flobject, ptr_flpopupentry, \
            ptr_flpopupentry_alt, ptr_flpopupitem)
    retval = _fl_insert_nmenu_items2(ptr_flobject, ptr_flpopupentry_alt, \
            ptr_flpopupitem)
    return retval
def fl_replace_nmenu_items2(ptr_flobject, ptr_flpopupentry, ptr_flpopupitem):
    """fl_replace_nmenu_items2(ptr_flobject, ptr_flpopupentry, ptr_flpopupitem)
    -> ptr_flpopupentry

    Replaces an item of a nmenu flobject (alternative).

    Parameters
    ----------
        ptr_flobject : pointer to xfdata.FL_OBJECT
            nmenu flobject
        ptr_flpopupentry : pointer to xfdata.FL_POPUP_ENTRY
            old popup entry to be replaced
        ptr_flpopupitem : pointer to xfdata.FL_POPUP_ITEM
            new popup item. It can be prepared passing a dict (whose keys
            are corresponding to xfdata.FL_POPUP_ITEM's members) to
            xfstruct.fls_make_ptr_flpopupitem function.

    Returns
    -------
        ptr_flpopupentry : pointer to xfdata.FL_POPUP_ENTRY
            first nmenu item, or None (on failure)

    Examples
    --------
        >>> *todo*

    Notes
    -----
        Status: NA-UTest + Doc + Demo = OK

    """
    _fl_replace_nmenu_items2 = library.cfuncproto(
        library.load_so_libforms(), "fl_replace_nmenu_items2",
        cty.POINTER(xfdata.FL_POPUP_ENTRY), [cty.POINTER(xfdata.FL_OBJECT),
        cty.POINTER(xfdata.FL_POPUP_ENTRY), cty.POINTER(xfdata.FL_POPUP_ITEM)],
        """FL_POPUP_ENTRY * fl_replace_nmenu_items2(FL_OBJECT * obj,
           FL_POPUP_ENTRY * p2, FL_POPUP_ITEM * p3)""")
    library.check_if_flinitialized()
    library.verify_flobjectptr_type(ptr_flobject)
    library.verify_flpopupentryptr_type(ptr_flpopupentry)
    library.verify_flpopupitemptr_type(ptr_flpopupitem)
    library.keep_elem_refs(ptr_flobject, ptr_flpopupentry, ptr_flpopupitem)
    retval = _fl_replace_nmenu_items2(ptr_flobject, ptr_flpopupentry, \
            ptr_flpopupitem)
    return retval
def fl_set_select_item(ptr_flobject, ptr_flpopupentry):
    """fl_set_select_item(ptr_flobject, ptr_flpopupentry) -> ptr_flpopupreturn

    Defines a new item of a select flobject as currently selected.

    Parameters
    ----------
        ptr_flobject : pointer to xfdata.FL_OBJECT
            select flobject
        ptr_flpopupentry : pointer to xfdata.FL_POPUP_ENTRY
            popup entry class instance. For it you can use the return value
            of any of fl_get_select_item_by_*() functions

    Returns
    -------
        ptr_flpopupreturn : pointer to xfdata.FL_POPUP_RETURN
            popup return

    Examples
    --------
        >>> *todo*

    Notes
    -----
        Status: NA-UTest + Doc + Demo = OK

    """
    _fl_set_select_item = library.cfuncproto(
        library.load_so_libforms(), "fl_set_select_item",
        cty.POINTER(xfdata.FL_POPUP_RETURN), [cty.POINTER(xfdata.FL_OBJECT),
        cty.POINTER(xfdata.FL_POPUP_ENTRY)],
        """FL_POPUP_RETURN * fl_set_select_item(FL_OBJECT * p1,
           FL_POPUP_ENTRY * p2)""")
    library.check_if_flinitialized()
    library.verify_flobjectptr_type(ptr_flobject)
    library.verify_flpopupentryptr_type(ptr_flpopupentry)
    library.keep_elem_refs(ptr_flobject, ptr_flpopupentry)
    retval = _fl_set_select_item(ptr_flobject, ptr_flpopupentry)
    return retval
def fl_delete_nmenu_item(ptr_flobject, ptr_flpopupentry):
    """fl_delete_nmenu_item(ptr_flobject, ptr_flpopupentry) -> result

    Deletes an item from a nmenu flobject.

    Parameters
    ----------
        ptr_flobject : pointer to xfdata.FL_OBJECT
            nmenu flobject
        ptr_flpopupentry : pointer to xfdata.FL_POPUP_ENTRY
            existing popup entry to delete

    Returns
    -------
        result : int
            0 (on success), or -1 (on failure)

    Examples
    --------
        >>> *todo*

    Notes
    -----
        Status: NA-UTest + Doc + NoDemo = Maybe

    """
    _fl_delete_nmenu_item = library.cfuncproto(
        library.load_so_libforms(), "fl_delete_nmenu_item",
        cty.c_int, [cty.POINTER(xfdata.FL_OBJECT),
        cty.POINTER(xfdata.FL_POPUP_ENTRY)],
        """int fl_delete_nmenu_item(FL_OBJECT * p1, FL_POPUP_ENTRY * p2)""")
    library.check_if_flinitialized()
    library.verify_flobjectptr_type(ptr_flobject)
    library.verify_flpopupentryptr_type(ptr_flpopupentry)
    library.keep_elem_refs(ptr_flobject, ptr_flpopupentry)
    retval = _fl_delete_nmenu_item(ptr_flobject, ptr_flpopupentry)
    return retval
def fl_replace_nmenu_item(ptr_flobject, ptr_flpopupentry, entryitemstxt,
            x=None, u=None, f=None, E=None, L=None, m=None, Rr=None, s=None):
    """fl_replace_nmenu_item(ptr_flobject, ptr_flpopupentry, entryitemstxt,
    x=None, u=None, f=None, E=None, L=None, m=None, Rr=None, s=None)
    -> ptr_flpopupentry

    Replaces an existing item of a nmenu flobject with another. If additional
    separated arguments are required by in-text special sequences, user must
    respect the same sequences' order.

    Parameters
    ----------
        ptr_flobject : pointer to xfdata.FL_OBJECT
            nmenu flobject
        ptr_flpopupentry : pointer to xfdata.FL_POPUP_ENTRY
            old popup entry to be replaced
        entryitemstxt : str
            text of the entry to be replaced and in-text special sequences
            with or without not separated additional arguments (if required).
            Text may contain "|" for more than one entry newline character
            which allows to create entries that span more than a single line.
            Special sequences who are allowed are: %x, %u, %f, %E, %L, %m or
            %T or %t, %R or %r or %l, %d, %h, %S, %s, %%. Special sequences of
            same type cannot be repeated in xforms-python.
        x : long
            numeric data to be passed to callbacks for entry (separated
            additional argument corresponding to %x in-text special sequence)
        u : pointer to any type
            user data to be passed to callbacks for entry; invoked callback
            has to take care of type check and re-cast ptr_void to chosen type
            using appropriate xfstruct.fls_convert_ptrvoid_to_* function (separated
            additional argument corresponding to %u in-text special sequence)
        f : python callback function, returned value
            name referring to function(ptr_flpopupreturn) -> int
            function to be invoked on set (separated additional argument
            corresponding to %f in-text special sequence)
        E : python callback function, returned unused value
            name referring to function(ptr_flpopupreturn) -> int
            function to be invoked on enter (separated additional argument
            corresponding to %E in-text special sequence)
        L : python callback function, returned unused value
            name referring to function(ptr_flpopupreturn) -> int
            function to be invoked on leave (separated additional argument
            corresponding to %L in-text special sequence)
        m : pointer to xfdata.FL_POPUP
            popup class to be used as sub-popup (separated additional argument
            corresponding to %m in-text special sequence)
        Rr : int
            group number of a radio entry type (separated additional argument
            corresponding to %R or %r in-text special sequence)
        s : str
            shortcut text for the entry (separated additional argument
            corresponding to %s in-text special sequence)

    Returns
    -------
        ptr_flpopupentry : pointer to xfdata.FL_POPUP_ENTRY
            popup entry

    Examples
    --------
        >>> *todo*

    Notes
    -----
        Status: NA-UTest + Doc + Demo = OK
        See: Special sequences in entry text documentation in xfdata.py.

    """
    # managing additional separate parameters
    l_x = ptr_u = cfn_f = cfn_E = cfn_L = i_Rr = s_s = None
    cparam_argstypelist = []
    specseqargslist = []
    if x:       # long x additional arg
        l_x = library.convert_to_longc(x)
        cparam_argstypelist.append(cty.c_long)
        specseqargslist.append(l_x)
    if u:       # pointer to void u additional arg
        ptr_u = library.convert_userdata_to_ptrvoid(u)
        cparam_argstypelist.append(cty.c_void_p)
        specseqargslist.append(ptr_u)
    if f:       # xfdata.FL_POPUP_CB f additional arg
        library.verify_function_type(f)
        cfn_f = xfdata.FL_POPUP_CB(f)
        cparam_argstypelist.append(xfdata.FL_POPUP_CB)
        specseqargslist.append(cfn_f)
    if E:       # xfdata.FL_POPUP_CB E additional arg
        library.verify_function_type(E)
        cfn_E = xfdata.FL_POPUP_CB(E)
        cparam_argstypelist.append(xfdata.FL_POPUP_CB)
        specseqargslist.append(cfn_E)
    if L:       # xfdata.FL_POPUP_CB L additional arg
        library.verify_function_type(L)
        cfn_L = xfdata.FL_POPUP_CB(L)
        cparam_argstypelist.append(xfdata.FL_POPUP_CB)
        specseqargslist.append(cfn_L)
    if m:       # pointer to xfdata.FL_POPUP m additional arg
        library.verify_flpopupptr_type(m)
        # passed as is
        cparam_argstypelist.append(cty.POINTER(xfdata.FL_POPUP))
        specseqargslist.append(m)
    if Rr:      # int R or r additional arg
        i_Rr = library.convert_to_intc(Rr)
        cparam_argstypelist.append(cty.c_int)
        specseqargslist.append(i_Rr)
    if s:      # str s additional arg
        s_s = library.convert_to_bytestrc(s)
        cparam_argstypelist.append(cty.c_char_p)
        specseqargslist.append(s_s)

    if not cparam_argstypelist:     # no additional separate params
        cparam_argstypelist = [cty.c_char_p, cty.c_char_p]
        specseqargslist = [b"", b""]
    elif len(cparam_argstypelist) < 2:  # just 1 param, add another
        cparam_argstypelist.append(cty.c_char_p)
        specseqargslist.append(b"")

    _fl_replace_nmenu_item = library.cfuncproto(
        library.load_so_libforms(), "fl_replace_nmenu_item",
        cty.POINTER(xfdata.FL_POPUP_ENTRY), [cty.POINTER(xfdata.FL_OBJECT),
        cty.POINTER(xfdata.FL_POPUP_ENTRY), xfdata.STRING, \
        cparam_argstypelist],
        """FL_POPUP_ENTRY * fl_replace_nmenu_item(FL_OBJECT * p1,
           FL_POPUP_ENTRY * p2, const char * p3, ...)""")
    library.check_if_flinitialized()
    library.verify_flobjectptr_type(ptr_flobject)
    library.verify_flpopupentryptr_type(ptr_flpopupentry)
    s_entryitemstxt = library.convert_to_bytestrc(entryitemstxt)
    library.keep_elem_refs(ptr_flobject, ptr_flpopupentry, entryitemstxt, \
            s_entryitemstxt, specseqargslist, cparam_argstypelist, x, u, f, \
            E, L, m, Rr, s, l_x, ptr_u, cfn_f, cfn_E, cfn_L, i_Rr, s_s)
    retval = _fl_replace_nmenu_item(ptr_flobject, ptr_flpopupentry, \
            s_entryitemstxt, *specseqargslist)
    return retval
def fl_insert_select_items(ptr_flobject, ptr_flpopupentry, entryitemstxt, \
        x=None, u=None, f=None, E=None, L=None, s=None):
    """fl_insert_select_items(ptr_flobject, ptr_flpopupentry, entryitemstxt,
    x=None, u=None, f=None, E=None, L=None, s=None)
    -> ptr_flpopupentry

    Inserts a new item somewhere in the middle of a list of already existing
    items (it can be used several times). If additional separated arguments
    are required by in-text special sequences, user must respect the same
    sequences' order.

    Parameters
    ----------
        ptr_flobject : pointer to xfdata.FL_OBJECT
            select flobject
        ptr_flpopupentry : pointer to xfdata.FL_POPUP_ENTRY
            popup entry. If it is None new items are inserted at the real start
        entryitemstxt : str
            text of the entry to be inserted and in-text special sequences
            with or without not separated additional arguments (if required).
            Text may contain "|" for more than one entry and newline character
            which allows to create entries that span more than a single line.
            Only some special sequences are allowed: %x, %u, %f, %E, %L, %d,
            %h, %S, %s, %% (other combinations do not make sense here). Special
            sequences of same type cannot be repeated in xforms-python.
        x : long
            numeric data to be passed to callbacks for entry (separated
            additional argument corresponding to %x in-text special sequence)
        u : pointer to any type
            user data to be passed to callbacks for entry; invoked callback
            has to take care of type check and re-cast ptr_void to chosen type
            using appropriate xfstruct.fls_convert_ptrvoid_to_* function (separated
            additional argument corresponding to %u in-text special sequence)
        f : python callback function, returned value
            name referring to function(ptr_flpopupreturn) -> int
            function to be invoked on set (separated additional argument
            corresponding to %f in-text special sequence)
        E : python callback function, returned unused value
            name referring to function(ptr_flpopupreturn) -> int
            function to be invoked on enter (separated additional argument
            corresponding to %E in-text special sequence)
        L : python callback function, returned unused value
            name referring to function(ptr_flpopupreturn) -> int
            function to be invoked on leave (separated additional argument
            corresponding to %L in-text special sequence)
        s : str
            shortcut text for the entry (separated additional argument
            corresponding to %s in-text special sequence)

    Returns
    -------
        ptr_flpopupentry : pointer to xfdata.FL_POPUP_ENTRY
            popup entry, or None (on failure)

    Examples
    --------
        >>> *todo*

    Notes
    -----
        Status: NA-UTest + Doc + Demo = OK
        See: Special sequences in entry text documentation in xfdata.py.

    """
    # managing additional separate parameters
    l_x = ptr_u = cfn_f = cfn_E = cfn_L = s_s = None
    cparam_argstypelist = []
    specseqargslist = []
    if x:       # long x additional arg
        l_x = library.convert_to_longc(x)
        cparam_argstypelist.append(cty.c_long)
        specseqargslist.append(l_x)
    if u:       # pointer to void u additional arg
        ptr_u = library.convert_userdata_to_ptrvoid(u)
        cparam_argstypelist.append(cty.c_void_p)
        specseqargslist.append(ptr_u)
    if f:       # xfdata.FL_POPUP_CB f additional arg
        library.verify_function_type(f)
        cfn_f = xfdata.FL_POPUP_CB(f)
        cparam_argstypelist.append(xfdata.FL_POPUP_CB)
        specseqargslist.append(cfn_f)
    if E:       # xfdata.FL_POPUP_CB E additional arg
        library.verify_function_type(E)
        cfn_E = xfdata.FL_POPUP_CB(E)
        cparam_argstypelist.append(xfdata.FL_POPUP_CB)
        specseqargslist.append(cfn_E)
    if L:       # xfdata.FL_POPUP_CB L additional arg
        library.verify_function_type(L)
        cfn_L = xfdata.FL_POPUP_CB(L)
        cparam_argstypelist.append(xfdata.FL_POPUP_CB)
        specseqargslist.append(cfn_L)
    if s:      # str s additional arg
        s_s = library.convert_to_bytestrc(s)
        cparam_argstypelist.append(cty.c_char_p)
        specseqargslist.append(s_s)

    if not cparam_argstypelist:     # no additional separate params
        cparam_argstypelist = [cty.c_char_p, cty.c_char_p]
        specseqargslist = [b"", b""]
    elif len(cparam_argstypelist) < 2:  # just 1 param, add another
        cparam_argstypelist.append(cty.c_char_p)
        specseqargslist.append(b"")

    _fl_insert_select_items = library.cfuncproto(
        library.load_so_libforms(), "fl_insert_select_items",
        cty.POINTER(xfdata.FL_POPUP_ENTRY), [cty.POINTER(xfdata.FL_OBJECT),
        cty.POINTER(xfdata.FL_POPUP_ENTRY), xfdata.STRING,
        cparam_argstypelist],
        """FL_POPUP_ENTRY * fl_insert_select_items(FL_OBJECT * p1,
           FL_POPUP_ENTRY * p2, const char * p3, ...)""")
    library.check_if_flinitialized()
    library.verify_flobjectptr_type(ptr_flobject)
    library.verify_flpopupentryptr_type(ptr_flpopupentry)
    s_entryitemstxt = library.convert_to_bytestrc(entryitemstxt)
    library.keep_elem_refs(ptr_flobject, ptr_flpopupentry, entryitemstxt, \
            s_entryitemstxt, specseqargslist, cparam_argstypelist, x, u, \
            f, E, L, s, l_x, ptr_u, cfn_f, cfn_E, cfn_L, s_s)
    retval = _fl_insert_select_items(ptr_flobject, ptr_flpopupentry, \
            s_entryitemstxt, *specseqargslist)
    return retval