[pygtk] Question concerning to detection of locale direction
Timo
timomlists at gmail.com
Thu Jun 27 17:42:27 WST 2013
Op 26-06-13 22:15, Genghis Khan schreef:
> As far as I understand, this code is for GTK3.
>
> Can you provide inputs that are of GTK2?
The documentation is your friend in programming!
https://developer.gnome.org/pygtk/stable/class-gtkwidget.html#function-gtk--widget-get-default-direction
>>> gtk.widget_get_default_direction() == gtk.TEXT_DIR_LTR
True
Timo
>
> Request is: Recognize direction of currently used GUI. (RTL or LTR)
>
> On Mon, 15 Apr 2013 11:10:14 +0200
> Timo <timomlists at gmail.com> wrote:
>
>> Op 15-04-13 10:38, Genghis Khan schreef:
>>> Hello,
>>>
>>> How is it possible to detect alignment of currently in-use gtk20.mo
>>> without directly probing gtk20.mo with msgunfmt for "default:RTL"?
>>>
>>> I have seen the following but I am not sure if it is applied to
>>> PyGTK, and I am also not sure it is relevant.
>>> https://developer.gnome.org/gtk3/3.4/GtkEntry.html#gtk-entry-get-alignment
>> I'm not really sure what you're asking, but I'm guessing you're
>> searching for the default text direction, right? If not, specify your
>> question.
>>
>> This should do it:
>>
>>>>> from gi.repository import Gtk
>>>>> Gtk.Widget.get_default_direction() == Gtk.TextDirection.LTR
>> True
>>>>> Gtk.Widget.set_default_direction(Gtk.TextDirection.RTL)
>>>>> button = Gtk.Button("Just for testing")
>>>>> button.get_direction() == Gtk.TextDirection.RTL
>> True
>>
>> Timo
>>
>>> Regards,
>>> --GK.
>>>
>> _______________________________________________
>> pygtk mailing list pygtk at daa.com.au
>> http://www.daa.com.au/mailman/listinfo/pygtk
>> Read the PyGTK FAQ: http://faq.pygtk.org/
>
More information about the pygtk
mailing list