From 2c570e5a92cfdb0b32c1ec1c0229082f932ce7f3 Mon Sep 17 00:00:00 2001 From: skomoroh Date: Fri, 15 Dec 2006 22:40:35 +0000 Subject: [PATCH] * some bugs fixes * cleanup code git-svn-id: file:///home/shlomif/Backup/svn-dumps/PySolFC/svnsync-repos/pysolfc/PySolFC/trunk@121 efabe8c0-fbe8-4139-b769-b5e6d273206e --- MANIFEST.in | 2 +- pysollib/app.py | 9 ++-- pysollib/help.py | 6 +-- pysollib/init.py | 34 ++++++++-------- pysollib/pysolgtk/tkutil.py | 3 -- pysollib/tile/menubar.py | 2 +- pysollib/tile/progressbar.py | 6 +-- pysollib/tile/tktree.py | 3 -- pysollib/tile/tkutil.py | 74 --------------------------------- pysollib/tile/tkwrap.py | 66 +----------------------------- pysollib/tk/progressbar.py | 6 +-- pysollib/tk/tkstats.py | 6 ++- pysollib/tk/tkutil.py | 12 ------ pysollib/tk/tkwrap.py | 77 +---------------------------------- pysollib/tk/toolbar.py | 2 +- pysollib/tksettings/aqua.py | 5 ++- pysollib/tksettings/common.py | 8 ++-- pysollib/tksettings/win32.py | 13 +++--- pysollib/tksettings/x11.py | 4 ++ setup.py | 1 + 20 files changed, 54 insertions(+), 285 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 5b37694e..e842ed20 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,7 +5,7 @@ ## include pysol.py setup.py setup.cfg MANIFEST.in Makefile COPYING README #recursive-include pysollib *.py -include pysollib/*.py pysollib/macosx/*.py +include pysollib/*.py pysollib/macosx/*.py pysollib/tksettings/*.py include pysollib/tk/*.py pysollib/tile/*.py pysollib/pysolgtk/*.py include pysollib/games/*.py pysollib/games/special/*.py include pysollib/games/ultra/*.py pysollib/games/mahjongg/*.py diff --git a/pysollib/app.py b/pysollib/app.py index 0078266e..ffd6097f 100644 --- a/pysollib/app.py +++ b/pysollib/app.py @@ -56,6 +56,7 @@ from game import Game from gamedb import GI, GAME_DB, loadGame from settings import TOP_SIZE, TOP_TITLE, TOOLKIT from settings import DEBUG +from tksettings import TkSettings # Toolkit imports from pysoltk import wm_withdraw, loadImage @@ -671,11 +672,9 @@ class Application: # create the canvas self.scrolled_canvas = MfxScrolledCanvas(self.top) self.canvas = self.scrolled_canvas.canvas - if WIN_SYSTEM == 'win32': - self.scrolled_canvas.grid(row=1, column=1, sticky='nsew', - padx=1, pady=1) - else: - self.scrolled_canvas.grid(row=1, column=1, sticky='nsew') + padx, pady = TkSettings.canvas_padding + self.scrolled_canvas.grid(row=1, column=1, sticky='nsew', + padx=padx, pady=pady) self.top.grid_columnconfigure(1, weight=1) self.top.grid_rowconfigure(1, weight=1) self.setTile(self.tabletile_index, force=True) diff --git a/pysollib/help.py b/pysollib/help.py index afedc1c3..05197d26 100644 --- a/pysollib/help.py +++ b/pysollib/help.py @@ -42,7 +42,7 @@ import Tkinter # PySol imports from mfxutil import EnvError from settings import PACKAGE, PACKAGE_URL, TOOLKIT, VERSION, FC_VERSION -from pysoltk import make_help_toplevel, wm_map, wm_set_icon +from pysoltk import make_help_toplevel, wm_map from pysoltk import MfxMessageDialog from pysoltk import HTMLViewer from gamedb import GAME_DB @@ -155,10 +155,6 @@ def help_html(app, document, dir_, top=None): else: #maximized = 0 top.wm_minsize(400, 200) - try: - wm_set_icon(top, app.dataloader.findIcon()) - except: - pass viewer = HTMLViewer(top, app, help_html_index) viewer.display(doc) #wm_map(top, maximized=maximized) diff --git a/pysollib/init.py b/pysollib/init.py index 5dfc1e3f..dd306bde 100644 --- a/pysollib/init.py +++ b/pysollib/init.py @@ -73,26 +73,28 @@ def init(): settings.TOOLKIT = 'tk' settings.USE_TILE = True sys.argv.remove('--tile') - elif settings.TOOLKIT == 'tk' and settings.USE_TILE == 'auto': - # check tile + if settings.TOOLKIT == 'tk': import Tkinter from Tkinter import TclError root = Tkinter.Tk() - # - # TkAqua displays the console automatically in application - # bundles, so we hide it here. - from macosx.appSupport import hideTkConsole - # - hideTkConsole(root) - root.withdraw() - settings.USE_TILE = False - try: - root.tk.call('package', 'require', 'tile', '0.7.8') - except TclError: - pass - else: - settings.USE_TILE = True settings.WIN_SYSTEM = root.tk.call('tk', 'windowingsystem') + if settings.WIN_SYSTEM == 'aqua': + # TkAqua displays the console automatically in application + # bundles, so we hide it here. + from macosx.appSupport import hideTkConsole + hideTkConsole(root) + # + root.withdraw() + if settings.USE_TILE == 'auto': + # check tile + settings.USE_TILE = False + try: + root.tk.call('package', 'require', 'tile', '0.7.8') + except TclError: + pass + else: + settings.USE_TILE = True + # "can't invoke event <>: application has been destroyed" #root.destroy() Tkinter._default_root = None diff --git a/pysollib/pysolgtk/tkutil.py b/pysollib/pysolgtk/tkutil.py index d96258ed..938abc89 100644 --- a/pysollib/pysolgtk/tkutil.py +++ b/pysollib/pysolgtk/tkutil.py @@ -51,9 +51,6 @@ def wm_deiconify(window): def wm_map(window, maximized=None): window.show() -def wm_set_icon(window, icon): - pass - def makeToplevel(parent, title=None, class_=None, gtkclass=gtk.Window): window = gtkclass() if not hasattr(window, 'table'): diff --git a/pysollib/tile/menubar.py b/pysollib/tile/menubar.py index 9cb09d69..a9b0de65 100644 --- a/pysollib/tile/menubar.py +++ b/pysollib/tile/menubar.py @@ -51,7 +51,7 @@ from pysollib.actions import PysolMenubarActions # toolkit imports from tkconst import EVENT_HANDLED, EVENT_PROPAGATE, CURSOR_WATCH, COMPOUNDS -from tkutil import bind, after_idle, load_theme +from tkutil import bind, after_idle from selectgame import SelectGameDialog, SelectGameDialogWithPreview from soundoptionsdialog import SoundOptionsDialog from selectcardset import SelectCardsetDialogWithPreview diff --git a/pysollib/tile/progressbar.py b/pysollib/tile/progressbar.py index c79cf1d6..91bb05de 100644 --- a/pysollib/tile/progressbar.py +++ b/pysollib/tile/progressbar.py @@ -41,7 +41,7 @@ import Tile as Tkinter # Toolkit imports from tkconst import EVENT_HANDLED, EVENT_PROPAGATE -from tkutil import makeToplevel, setTransient, wm_set_icon +from tkutil import makeToplevel, setTransient # /*********************************************************************** @@ -72,10 +72,6 @@ class PysolProgressBar: else: self.progress.pack(expand='yes', fill='x') self.frame.pack(expand='yes', fill='both') - if app: - try: - wm_set_icon(self.top, app.dataloader.findIcon()) - except: pass if 1: setTransient(self.top, None, relx=0.5, rely=0.5) else: diff --git a/pysollib/tile/tktree.py b/pysollib/tile/tktree.py index 1a40a051..f31264da 100644 --- a/pysollib/tile/tktree.py +++ b/pysollib/tile/tktree.py @@ -239,9 +239,6 @@ class MfxTreeInCanvas(MfxScrolledCanvas): self.font = None self.linestyle = "gray50" self.linecolor = "black" - if WIN_SYSTEM == "win32": - self.linestyle = "" # Tk bug ? - self.linecolor = "gray50" def __init__(self, parent, rootnodes, **kw): kw['bd'] = 0 diff --git a/pysollib/tile/tkutil.py b/pysollib/tile/tkutil.py index 47fad529..323c8cc4 100644 --- a/pysollib/tile/tkutil.py +++ b/pysollib/tile/tkutil.py @@ -36,7 +36,6 @@ __all__ = ['wm_withdraw', 'wm_deiconify', 'wm_map', - 'wm_set_icon', 'wm_get_geometry', #'setTransient', #'makeToplevel', @@ -53,8 +52,6 @@ __all__ = ['wm_withdraw', 'createImage', 'shadowImage', 'get_text_width', - #'init_tile', - #'load_theme', ] # imports @@ -91,17 +88,6 @@ def wm_map(window, maximized=0): else: wm_deiconify(window) -def wm_set_icon(window, filename): - if not filename: - return - if WIN_SYSTEM == 'win32': - ##window.tk.call('wm', 'iconbitmap', root._w, '-default', '@'+filename) - pass - elif WIN_SYSTEM == 'x11': - ##window.wm_iconbitmap("@"+filename) - ##window.wm_iconmask("@"+filename) - pass - __wm_get_geometry_re = re.compile(r"^(\d+)x(\d+)\+([\-]?\d+)\+([\-]?\d+)$") def wm_get_geometry(window): @@ -383,64 +369,4 @@ def get_text_width(text, font, root=None): return Font(root=root, font=font).measure(text) -# /*********************************************************************** -# // -# ************************************************************************/ - -def init_tile(app, top, theme): - if WIN_SYSTEM == 'x11': - f = os.path.join(app.dataloader.dir, 'tcl', 'menu8.4.tcl') - if os.path.exists(f): - top.tk.call('source', f) - top.tk.call("package", "require", "tile") - # load available themes - d = os.path.join(app.dataloader.dir, 'themes') - if os.path.isdir(d): - top.tk.call('lappend', 'auto_path', d) - for t in os.listdir(d): - if os.path.exists(os.path.join(d, t, 'pkgIndex.tcl')): - try: - top.tk.call('package', 'require', 'tile::theme::'+t) - #print 'load theme:', t - except: - traceback.print_exc() - pass - # - load_theme(app, top, theme) - -def load_theme(app, top, theme): - # set theme - style = Tkinter.Style(top) - all_themes = style.theme_names() - if theme not in all_themes: - print >> sys.stderr, 'WARNING: invalid theme name:', theme - theme = 'default' - if theme: - style.theme_use(theme) - if WIN_SYSTEM == 'x11': - color = style.lookup('.', 'background') - if color: - top.tk_setPalette(color) - color = style.lookup('.', 'background', 'active') - if color: - top.option_add('*Menu.activeBackground', color) - elif WIN_SYSTEM == 'win32': - if theme not in ('winnative', 'xpnative'): - color = style.lookup('.', 'background') - if color: - top.tk_setPalette(color) - ##top.option_add('*Menu.foreground', 'black') - top.option_add('*Menu.activeBackground', '#08246b') - top.option_add('*Menu.activeForeground', 'white') - if theme == 'winnative': - style.configure('Toolbutton', padding=2) - font = app.opt.fonts['default'] - if font: - style.configure('.', font=font) - else: - font = style.lookup('.', 'font') - if font: - top.option_add('*font', font) - - diff --git a/pysollib/tile/tkwrap.py b/pysollib/tile/tkwrap.py index afb87b6b..91ee928a 100644 --- a/pysollib/tile/tkwrap.py +++ b/pysollib/tile/tkwrap.py @@ -47,9 +47,9 @@ from tkFont import Font # PySol imports from pysollib.mfxutil import destruct, Struct -from pysollib.settings import PACKAGE, VERSION, WIN_SYSTEM +from pysollib.settings import PACKAGE, VERSION from pysollib.macosx.appSupport import setupApp -from tkutil import after_idle, init_tile, wm_set_icon +from tkutil import after_idle from tkconst import EVENT_HANDLED, EVENT_PROPAGATE # /*********************************************************************** @@ -99,68 +99,6 @@ class MfxRoot(Tkinter.Tk): def connectApp(self, app): self.app = app - def initToolkit(self, app, fg=None, bg=None, font=None): - setupApp(app) - sw, sh, sd = self.winfo_screenwidth(), self.winfo_screenheight(), self.winfo_screendepth() - self.wm_group(self) - self.wm_title(PACKAGE + ' ' + VERSION) - self.wm_iconname(PACKAGE + ' ' + VERSION) - if sw < 640 or sh < 480: - self.wm_minsize(400, 300) - else: - self.wm_minsize(540, 380) - ##self.self.wm_maxsize(9999, 9999) # unlimited - self.wm_protocol('WM_DELETE_WINDOW', self.wmDeleteWindow) - prog = sys.executable - if prog and os.path.isfile(prog): - argv0 = os.path.normpath(sys.argv[0]) - prog = os.path.abspath(prog) - if os.path.isfile(argv0): - wm_command = prog + " " + os.path.abspath(argv0) - self.wm_command(wm_command) - if 1: - # set expected window size to assist the layout of the window manager - self.config(width=min(800,sw-64), height=min(600,sh-64)) - try: - wm_set_icon(self, app.dataloader.findIcon()) - except: pass - - # font - if font: - self.option_add('*font', font) - elif WIN_SYSTEM == 'x11': - self.option_add('*font', 'Helvetica 12', 50) - font = self.option_get('font', '') - try: - f = Font(self, font) - except: - print >> sys.stderr, 'invalid font name:', font - pass - else: - if font: - fa = f.actual() - app.opt.fonts['default'] = (fa['family'], - fa['size'], - fa['slant'], - fa['weight']) - else: - app.opt.fonts['default'] = None - - # theme - try: - init_tile(app, self, app.opt.tile_theme) - except TclError: - raise - except Exception, err: - print >> sys.stderr, 'ERROR: set theme:', err - ##self.option_add('*Toolbar.relief', 'groove') - ##self.option_add('*Toolbar.relief', 'raised') - ##self.option_add('*Toolbar.borderWidth', 1) - ##self.option_add('*Toolbar.Button.Pad', 2) - ##self.option_add('*Toolbar.Button.default', 'disabled') - ##self.option_add('*Toolbar*takeFocus', 0) - - # sometimes an update() is needed under Windows, whereas # under Unix an update_idletasks() would be enough... def busyUpdate(self): diff --git a/pysollib/tk/progressbar.py b/pysollib/tk/progressbar.py index cbbc3b62..59373880 100644 --- a/pysollib/tk/progressbar.py +++ b/pysollib/tk/progressbar.py @@ -40,7 +40,7 @@ import os, sys, Tkinter # Toolkit imports from tkconst import EVENT_HANDLED, EVENT_PROPAGATE -from tkutil import makeToplevel, setTransient, wm_set_icon +from tkutil import makeToplevel, setTransient # /*********************************************************************** @@ -75,10 +75,6 @@ class PysolProgressBar: self.f2 = Tkinter.Label(self.frame, image=images[1]) self.f2.grid_configure(column=2, row=0, sticky="ew", ipadx=8, ipady=4) self.top.config(cursor="watch") - if app: - try: - wm_set_icon(self.top, app.dataloader.findIcon()) - except: pass self.pack() if 1: setTransient(self.top, None, relx=0.5, rely=0.5) diff --git a/pysollib/tk/tkstats.py b/pysollib/tk/tkstats.py index 58a842d4..1ffbbe72 100644 --- a/pysollib/tk/tkstats.py +++ b/pysollib/tk/tkstats.py @@ -331,7 +331,7 @@ class CanvasFormatter(PysolStatsFormatter): def pstats(self, y, args, gameid=None): x = 1 t1, t2, t3, t4, t5, t6, t7 = args - self.gamenumber = None + self.gameid = gameid if gameid is None: # header self.gameid = 'header' for var, text, anchor, tab in ( @@ -342,6 +342,7 @@ class CanvasFormatter(PysolStatsFormatter): ('time', t5, 'ne', self._tabs[5]), ('moves', t6, 'ne', self._tabs[6]), ('percent', t7, 'ne', self._tabs[7]), ): + self.gamenumber = None if gameid is None: # header self.gamenumber=var id = self.canvas.create_text(x, y, text=text, anchor=anchor, @@ -477,6 +478,7 @@ class AllGames_StatsDialog(MfxDialog): self.player = player self.title = title self.sort_by = 'name' + self.selected_game = None # kwdefault(kw, width=self.CHAR_W*64, height=lines*self.CHAR_H) kw = self.initKw(kw) @@ -535,7 +537,7 @@ class AllGames_StatsDialog(MfxDialog): id = self.canvas.find_withtag(Tkinter.CURRENT) if not id: return - ##print id, self.nodes.get(id[0]) + ##print 'singleClick:', id, self.nodes.get(id[0]) gameid, gamenumber = self.nodes.get(id[0], (None, None)) if gameid == 'header': if self.sort_by == gamenumber: return diff --git a/pysollib/tk/tkutil.py b/pysollib/tk/tkutil.py index a44b7148..867e85a1 100644 --- a/pysollib/tk/tkutil.py +++ b/pysollib/tk/tkutil.py @@ -36,7 +36,6 @@ __all__ = ['wm_withdraw', 'wm_deiconify', 'wm_map', - 'wm_set_icon', 'wm_get_geometry', #'setTransient', #'makeToplevel', @@ -89,17 +88,6 @@ def wm_map(window, maximized=0): else: wm_deiconify(window) -def wm_set_icon(window, filename): - if not filename: - return - if WIN_SYSTEM == 'win32': - pass - ##window.wm_iconbitmap(default="@"+filename) - elif WIN_SYSTEM == "x11": - pass - ##window.wm_iconbitmap("@" + filename) - ##window.wm_iconmask("@" + filename) - __wm_get_geometry_re = re.compile(r"^(\d+)x(\d+)\+([\-]?\d+)\+([\-]?\d+)$") def wm_get_geometry(window): diff --git a/pysollib/tk/tkwrap.py b/pysollib/tk/tkwrap.py index f1e1d372..582f752c 100644 --- a/pysollib/tk/tkwrap.py +++ b/pysollib/tk/tkwrap.py @@ -49,7 +49,7 @@ from tkFont import Font from pysollib.mfxutil import destruct, Struct from pysollib.settings import PACKAGE, VERSION, WIN_SYSTEM from pysollib.macosx.appSupport import setupApp -from tkutil import after_idle, wm_set_icon +from tkutil import after_idle from tkconst import EVENT_HANDLED, EVENT_PROPAGATE @@ -100,81 +100,6 @@ class MfxRoot(Tkinter.Tk): def connectApp(self, app): self.app = app - def initToolkit(self, app, fg=None, bg=None, font=None, theme=None): - setupApp(app) - sw, sh, sd = self.winfo_screenwidth(), self.winfo_screenheight(), self.winfo_screendepth() - self.wm_group(self) - self.wm_title(PACKAGE + ' ' + VERSION) - self.wm_iconname(PACKAGE + ' ' + VERSION) - if sw < 640 or sh < 480: - self.wm_minsize(400, 300) - else: - self.wm_minsize(520, 360) - ##self.self.wm_maxsize(9999, 9999) # unlimited - self.wm_protocol('WM_DELETE_WINDOW', self.wmDeleteWindow) - prog = sys.executable - if prog and os.path.isfile(prog): - argv0 = os.path.normpath(sys.argv[0]) - prog = os.path.abspath(prog) - if os.path.isfile(argv0): - wm_command = prog + " " + os.path.abspath(argv0) - self.wm_command(wm_command) - if 1: - # set expected window size to assist the layout of the window manager - self.config(width=min(800,sw-64), height=min(600,sh-64)) - try: - wm_set_icon(self, app.dataloader.findIcon()) - except: pass - - # set global color scheme - if not fg and not bg: - if WIN_SYSTEM == 'x11': # Unix/X11 - pass - else: - if bg: - self.tk_setPalette(bg) - app.top_palette[1] = bg - app.top_bg = bg - if fg: - self.option_add('*foreground', fg) - app.top_palette[0] = fg - - # - if WIN_SYSTEM == 'x11': # Unix/X11 - self.option_add('*Entry.background', 'white', 60) - self.option_add('*Entry.foreground', 'black', 60) - self.option_add('*Listbox.background', 'white', 60) - self.option_add('*Listbox.foreground', 'black', 60) - ##self.option_add('*borderWidth', '1', 50) - ##self.option_add('*Button.borderWidth', '1', 50) - self.option_add('*Scrollbar.elementBorderWidth', '1', 60) - self.option_add('*Scrollbar.borderWidth', '1', 60) - self.option_add('*Menu.borderWidth', '1', 60) - #self.option_add('*Button.HighlightBackground', '#595d59') - #self.option_add('*Button.HighlightThickness', '1') - - # font - if font: - self.option_add('*font', font) - elif WIN_SYSTEM == 'x11': - self.option_add('*font', 'Helvetica 12', 50) - font = self.option_get('font', '') - try: - f = Font(self, font) - except: - print >> sys.stderr, 'invalid font name:', font - pass - else: - if font: - fa = f.actual() - app.opt.fonts['default'] = (fa['family'], - fa['size'], - fa['slant'], - fa['weight']) - else: - app.opt.fonts['default'] = None - - # sometimes an update() is needed under Windows, whereas # under Unix an update_idletasks() would be enough... def busyUpdate(self): diff --git a/pysollib/tk/toolbar.py b/pysollib/tk/toolbar.py index 66fcdde1..394e709b 100644 --- a/pysollib/tk/toolbar.py +++ b/pysollib/tk/toolbar.py @@ -47,7 +47,7 @@ except ImportError: # PySol imports from pysollib.mfxutil import destruct from pysollib.util import IMAGE_EXTENSIONS -from pysollib.settings import PACKAGE, WIN_SYSTEM +from pysollib.settings import PACKAGE from pysollib.actions import PysolToolbarActions from pysollib.tksettings import TkSettings diff --git a/pysollib/tksettings/aqua.py b/pysollib/tksettings/aqua.py index 5f97b694..fdb78263 100644 --- a/pysollib/tksettings/aqua.py +++ b/pysollib/tksettings/aqua.py @@ -31,8 +31,9 @@ from common import baseInitRootWindow, BaseTkSettings class initRootWindow(baseInitRootWindow): def __init__(self, root, app): baseInitRootWindow.__init__(self, root, app) - #setupApp(app) - hideTkConsole(root) + if TOOLKIT == 'tk': + #setupApp(app) + hideTkConsole(root) if TOOLKIT == 'gtk': pass elif USE_TILE: diff --git a/pysollib/tksettings/common.py b/pysollib/tksettings/common.py index 00717c1d..df3ca402 100644 --- a/pysollib/tksettings/common.py +++ b/pysollib/tksettings/common.py @@ -24,7 +24,6 @@ import sys, os, traceback from pysollib.settings import PACKAGE, VERSION from pysollib.settings import TOOLKIT, USE_TILE from pysollib.tile import Tile -from pysollib.pysoltk import wm_set_icon def init_tile(app, top, theme): @@ -57,9 +56,9 @@ class baseInitRootWindow: #root.wm_group(root) root.wm_title(PACKAGE + ' ' + VERSION) root.wm_iconname(PACKAGE + ' ' + VERSION) - try: - wm_set_icon(root, app.dataloader.findIcon()) - except: pass + + root.wm_protocol('WM_DELETE_WINDOW', root.wmDeleteWindow) + # set minsize sw, sh, sd = (root.winfo_screenwidth(), root.winfo_screenheight(), @@ -79,6 +78,7 @@ class baseInitRootWindow: pass class BaseTkSettings: + canvas_padding = (0, 0) toolbar_button_padding = (2, 2) toolbar_label_padding = (4, 4) if USE_TILE: diff --git a/pysollib/tksettings/win32.py b/pysollib/tksettings/win32.py index 6fe4b838..b8468e38 100644 --- a/pysollib/tksettings/win32.py +++ b/pysollib/tksettings/win32.py @@ -24,7 +24,7 @@ import sys, os from pysollib.settings import TOOLKIT, USE_TILE from pysollib.tile import Tile -from common import baseInitRootWindow +from common import baseInitRootWindow, BaseTkSettings class initRootWindow(baseInitRootWindow): @@ -34,13 +34,14 @@ class initRootWindow(baseInitRootWindow): pass elif USE_TILE: theme = app.opt.tile_theme + style = Tile.Style(root) if theme not in ('winnative', 'xpnative'): color = style.lookup('.', 'background') if color: - top.tk_setPalette(color) - ##top.option_add('*Menu.foreground', 'black') - top.option_add('*Menu.activeBackground', '#08246b') - top.option_add('*Menu.activeForeground', 'white') + root.tk_setPalette(color) + ##root.option_add('*Menu.foreground', 'black') + root.option_add('*Menu.activeBackground', '#08246b') + root.option_add('*Menu.activeForeground', 'white') if theme == 'winnative': style.configure('Toolbutton', padding=2) else: @@ -49,9 +50,9 @@ class initRootWindow(baseInitRootWindow): class TkSettings(BaseTkSettings): + canvas_padding = (1, 1) toolbar_relief = 'groove' toolbar_borderwidth = 2 if USE_TILE: toolbar_button_padding = (2, 0) - toolbar_label_padding = (6, 6) diff --git a/pysollib/tksettings/x11.py b/pysollib/tksettings/x11.py index 3f92ecff..3ee9fd1f 100644 --- a/pysollib/tksettings/x11.py +++ b/pysollib/tksettings/x11.py @@ -35,6 +35,10 @@ class initRootWindow(baseInitRootWindow): def __init__(self, root, app): baseInitRootWindow.__init__(self, root, app) +## if TOOLKIT == 'tk': +## window.wm_iconbitmap("@"+filename) +## window.wm_iconmask("@"+filename) + ##root.self.wm_maxsize(9999, 9999) # unlimited if TOOLKIT == 'gtk': pass diff --git a/setup.py b/setup.py index 6ec5b87d..ccbdf1c2 100644 --- a/setup.py +++ b/setup.py @@ -66,6 +66,7 @@ kw = { 'scripts' : ['pysol.py'], 'packages' : ['pysollib', 'pysollib.macosx', + 'pysollib.tksettings', 'pysollib.tk', 'pysollib.tile', 'pysollib.pysolgtk',