View Single Post
Posts: 146 | Thanked: 15 times | Joined on Oct 2008
#30
Just for the record, this is what I did.
I created a function with the following code:
Code:
    def makefont(self):
        Settings=gtk.settings_get_for_screen(gdk.screen_get_default())

        gtk.rc_parse_string("""
                style "general-font"
                {
                    font_name = "Sans """+str(self.font)+""" "
                }
                style "out-font"
                {
                    font_name = "Sans """+str(self.font+6)+""" "
                }
                style "label-font"
                {
                    font_name = "Sans bold """+str(self.font-4)+""" "
                }
                class "*" style "general-font"
                class "GtkTreeView" style "out-font"
                class "GtkLabel" style "label-font"
                """)

        gtk.rc_reset_styles(Settings)
and I call this function at the initialization of the program, and each time the variable self.font changes.

The only strange thing is that the GtkLabel works fine in the PC, but not on the N800: the label of the buttons remain unchanged, although the labels on the dialogs change. It seems that the gtk.ToggleButton is implemented differently in the different pythons.

Thanks for all your help!
L.