def fl_set_select_popup(ptr_flobject, ptr_flpopup): """fl_set_select_popup(ptr_flobject, ptr_flpopup) -> result Creates a popup directly and then associates it with the select flobject. Supplied popup may not contain any entries other than those of type xfdata.FL_POPUP_NORMAL, and, of course, the popup cannot be a sub-popup of another popup). Parameters ---------- ptr_flobject : pointer to xfdata.FL_OBJECT select flobject ptr_flpopup : pointer to xfdata.FL_POPUP popup class instance Returns ------- result : int 1 on success, or -1 (on failure) Examples -------- >>> *todo* Notes ----- Status: NA-UTest + Doc + NoDemo = Maybe """ _fl_set_select_popup = library.cfuncproto( library.load_so_libforms(), "fl_set_select_popup", cty.c_int, [cty.POINTER(xfdata.FL_OBJECT), cty.POINTER(xfdata.FL_POPUP)], """int fl_set_select_popup(FL_OBJECT * p1, FL_POPUP * p2)""") library.check_if_flinitialized() library.verify_flobjectptr_type(ptr_flobject) library.verify_flpopupptr_type(ptr_flpopup) library.keep_elem_refs(ptr_flobject, ptr_flpopup) retval = _fl_set_select_popup(ptr_flobject, ptr_flpopup) return retval
def fl_set_nmenu_popup(ptr_flobject, ptr_flpopup): """fl_set_nmenu_popup(ptr_flobject, ptr_flpopup) -> ptr_flpopup Defines an existing popup as the nmenu's popup. The popup you associate with the nmenu flobject in this way cannot be a sub-popup. Parameters ---------- ptr_flobject : pointer to xfdata.FL_OBJECT nmenu flobject ptr_flpopup : pointer to xfdata.FL_POPUP popup class instance Returns ------- ptr_flpopup : pointer to xfdata.FL_POPUP popup class instance Examples -------- >>> *todo* Notes ----- Status: NA-UTest + Doc + NoDemo = Maybe """ _fl_set_nmenu_popup = library.cfuncproto( library.load_so_libforms(), "fl_set_nmenu_popup", cty.c_int, [cty.POINTER(xfdata.FL_OBJECT), cty.POINTER(xfdata.FL_POPUP)], """int fl_set_nmenu_popup(FL_OBJECT * p1, FL_POPUP * p2)""") library.check_if_flinitialized() library.verify_flobjectptr_type(ptr_flobject) library.verify_flpopupptr_type(ptr_flpopup) library.keep_elem_refs(ptr_flobject, ptr_flpopup) retval = _fl_set_nmenu_popup(ptr_flobject, ptr_flpopup) 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