preference::type::new (public)

 preference::type::new [ -preference_type_id preference_type_id ] \
    -package_key package_key -short_name short_name \
    -pretty_name pretty_name [ -datatype datatype ] \
    [ -options options ] [ -default_value default_value ]

Defined in packages/user-preferences/tcl/preference-types-procs.tcl

Create a new preference type. The preference can be set at four different levels. See get_user_pref for more details.

Switches:
-preference_type_id (optional)
-package_key (required)
-short_name (required)
This is the name that will be used to set or retrieve the preference using set_user_pref or get_user_pref.
-pretty_name (required)
-datatype (optional, defaults to "text")
-options (optional)
-default_value (optional)
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 oacs_util::vars_to_ns_set oacs_util::vars_to_ns_set (public, deprecated) package_instantiate_object package_instantiate_object (public) preference::type::new preference::type::new preference::type::new->oacs_util::vars_to_ns_set preference::type::new->package_instantiate_object

Testcases:
No testcase defined.
Source code:
        # Set up the vars
        set extra_vars [ns_set create]
        oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {preference_type_id package_key short_name pretty_name datatype options default_value}

        # Instantiate the pref
        set preference_type_id [package_instantiate_object -extra_vars $extra_vars user_pref_type]

        return $preference_type_id
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: