Example #1
0
def styleNotebook(notebook):
    theme = "maeddlaevtabtheme"
    style = Style()

    # only create theme if not exists
    s = Style()
    if not theme in s.theme_names():
        style.theme_create( theme, parent="alt", settings={
            "TNotebook": {"configure": {"tabmargins": [2, 5, 2, 0], "background" : rootColor} },
            "TNotebook.Tab": {
                "configure": {"padding": [5, 1], "background": rootColor, 
                              "font" : ("Helvetica", 15, "bold") },
                "map":       {"background": [("selected", rootColor)] } } } )

    
    style.theme_use(theme)
    return notebook
Example #2
0
def _init_theme():
    global _style
    try:
        if not _style:
            _style = Style()
            try:
                _style.theme_use("alt")
            except TclError:
                _style.theme_use("default")
            _style.theme_create("Llia", parent="alt", settings = {
                "TNotebook" : {"configure" : {"tabmargins" : [2,5,2,0]}},

                "TNotebook.Tab" : {"configure" : {"padding" : [5,1],
                                                  "background" : pallet("TAB-BG"),
                                                  "foreground" : pallet("TAB-FG")},
                                   "map" : {"background" : [("selected", pallet("TAB-SELECTED-BG"))],
                                            "foreground" : [("selected", pallet("TAB-SELECTED-FG"))],
                                            "expand" : [("selected", [1,1,1,0])] }}})
            _style.theme_use("Llia")
    except TclError:
        # Raised if Llia theme already exists
        pass  
Example #3
0
def _init_theme():
    global _style
    try:
        if not _style:
            _style = Style()
            try:
                _style.theme_use("alt")
            except TclError:
                _style.theme_use("default")
            _style.theme_create("Llia", parent="alt", settings = {
                "TNotebook" : {"configure" : {"tabmargins" : [2,5,2,0]}},

                "TNotebook.Tab" : {"configure" : {"padding" : [5,1],
                                                  "background" : pallet("TAB-BG"),
                                                  "foreground" : pallet("TAB-FG")},
                                   "map" : {"background" : [("selected", pallet("TAB-SELECTED-BG"))],
                                            "foreground" : [("selected", pallet("TAB-SELECTED-FG"))],
                                            "expand" : [("selected", [1,1,1,0])] }}})
            _style.theme_use("Llia")
    except TclError:
        # Raised if Llia theme already exists
        pass