Package: gtk

Function gtk:locale-direction

Lambda List

gtk:locale-direction ()

Return Value

The gtk:text-direction value of the current locale.

Details

Gets the direction of the current locale. This is the expected reading direction for text and UI. This function depends on the current locale being set with the setlocale() function and will default to setting the :ltr direction otherwise. The :none direction will never be returned.

GTK sets the default text direction according to the locale during the gtk:init function, and you should normally use the gtk:widget-direction or gtk:widget-default-direction functions to obtain the current direction.

This function is only needed rare cases when the locale is changed after GTK has already been initialized.

Examples

You can use the gtk:locale-direction function to update the default text direction as follows:
(setf (gtk:widget-default-direction) (gtk:locale-direction))
=> :LTR    
 

See also

2024-11-5