mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
* some windows-specific changes
git-svn-id: file:///home/shlomif/Backup/svn-dumps/PySolFC/svnsync-repos/pysolfc/PySolFC/trunk@139 efabe8c0-fbe8-4139-b769-b5e6d273206e
This commit is contained in:
parent
5175caf86a
commit
4b70ba795c
4 changed files with 15 additions and 12 deletions
|
@ -103,15 +103,11 @@ def init():
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
if sys.path[0] and not os.path.isdir(sys.path[0]): # i.e. library.zip
|
if sys.path[0] and not os.path.isdir(sys.path[0]): # i.e. library.zip
|
||||||
d = os.path.dirname(sys.path[0])
|
d = os.path.dirname(sys.path[0])
|
||||||
##d = os.path.join(d, 'freecell-solver')
|
|
||||||
fcs_command = os.path.join('freecell-solver', 'fc-solve.exe')
|
|
||||||
##fcs_command = '"%s"' % fcs_command # quote command
|
|
||||||
settings.FCS_COMMAND = fcs_command
|
|
||||||
f = os.path.join(d, 'freecell-solver', 'presetrc')
|
|
||||||
os.environ['FREECELL_SOLVER_PRESETRC'] = f
|
|
||||||
os.chdir(d) # for read presets
|
os.chdir(d) # for read presets
|
||||||
##print >> file('/fcs.log', 'a'), d
|
fcs_command = os.path.join('freecell-solver', 'fc-solve.exe')
|
||||||
##print >> file('/fcs.log', 'a'), f
|
settings.FCS_COMMAND = fcs_command
|
||||||
|
##f = os.path.join(d, 'freecell-solver', 'presetrc')
|
||||||
|
##os.environ['FREECELL_SOLVER_PRESETRC'] = f # defined in prefix.h
|
||||||
if os.name in ('posix', 'nt'):
|
if os.name in ('posix', 'nt'):
|
||||||
try:
|
try:
|
||||||
pin, pout, perr = os.popen3(settings.FCS_COMMAND+' --help')
|
pin, pout, perr = os.popen3(settings.FCS_COMMAND+' --help')
|
||||||
|
|
|
@ -351,16 +351,20 @@ class PysolToolbar(PysolToolbarActions):
|
||||||
|
|
||||||
if side == 1:
|
if side == 1:
|
||||||
# top
|
# top
|
||||||
pack_func(row=0, column=1, sticky='ew', padx=0, pady=0)
|
padx, pady = TkSettings.horizontal_toolbar_padding
|
||||||
|
pack_func(row=0, column=1, sticky='ew', padx=padx, pady=pady)
|
||||||
elif side == 2:
|
elif side == 2:
|
||||||
# bottom
|
# bottom
|
||||||
pack_func(row=2, column=1, sticky='ew', padx=0, pady=0)
|
padx, pady = TkSettings.horizontal_toolbar_padding
|
||||||
|
pack_func(row=2, column=1, sticky='ew', padx=padx, pady=pady)
|
||||||
elif side == 3:
|
elif side == 3:
|
||||||
# left
|
# left
|
||||||
pack_func(row=1, column=0, sticky='ns', padx=0, pady=1)
|
padx, pady = TkSettings.vertical_toolbar_padding
|
||||||
|
pack_func(row=1, column=0, sticky='ns', padx=padx, pady=pady)
|
||||||
else:
|
else:
|
||||||
# right
|
# right
|
||||||
pack_func(row=1, column=2, sticky='ns', padx=0, pady=1)
|
padx, pady = TkSettings.vertical_toolbar_padding
|
||||||
|
pack_func(row=1, column=2, sticky='ns', padx=padx, pady=pady)
|
||||||
# set orient
|
# set orient
|
||||||
orient = side in (1, 2) and Tkinter.HORIZONTAL or Tkinter.VERTICAL
|
orient = side in (1, 2) and Tkinter.HORIZONTAL or Tkinter.VERTICAL
|
||||||
self._setOrient(orient)
|
self._setOrient(orient)
|
||||||
|
|
|
@ -97,6 +97,8 @@ class baseInitRootWindow:
|
||||||
|
|
||||||
class BaseTkSettings:
|
class BaseTkSettings:
|
||||||
canvas_padding = (0, 0)
|
canvas_padding = (0, 0)
|
||||||
|
horizontal_toolbar_padding = (0, 0)
|
||||||
|
vertical_toolbar_padding = (0, 1)
|
||||||
toolbar_button_padding = (2, 2)
|
toolbar_button_padding = (2, 2)
|
||||||
toolbar_label_padding = (4, 4)
|
toolbar_label_padding = (4, 4)
|
||||||
if USE_TILE:
|
if USE_TILE:
|
||||||
|
|
|
@ -51,6 +51,7 @@ class initRootWindow(baseInitRootWindow):
|
||||||
|
|
||||||
class TkSettings(BaseTkSettings):
|
class TkSettings(BaseTkSettings):
|
||||||
canvas_padding = (1, 1)
|
canvas_padding = (1, 1)
|
||||||
|
horizontal_toolbar_padding = (1, 0)
|
||||||
toolbar_relief = 'groove'
|
toolbar_relief = 'groove'
|
||||||
toolbar_borderwidth = 2
|
toolbar_borderwidth = 2
|
||||||
if USE_TILE:
|
if USE_TILE:
|
||||||
|
|
Loading…
Add table
Reference in a new issue