2009-12-28 41 views
1

在PyWin32演示文件夾中,win32gui_dialog.py示例使用經典的Windows控制。 也可以使用PyWin32顯示Windows Vista主題按鈕,如果是這樣,怎麼樣?我使用ActivePython 3.1,如果這有什麼區別。PyWin32:Windows經典主題

樣品:

PyWin32 http://imagespark.net/files/old.png

+1

的相關興趣:新的'ttk'模塊提供了幾乎原生Windows vista/7的主題 - http://docs.python.org/dev/library/ttk.html ...截圖可在:http: //tkdocs.com/tutorial – 2010-01-03 21:59:36

回答

2

簡短的回答:一個肯定的。

我知道這是可能的,因爲我已經看到它之前完成。但我不完全確定它是如何完成的。

至少,你可以使用IronPython並使用Windows的內置.NET框架通過使用clr。

如果您對IronPython不感興趣,那麼您可以考慮一些沿着easyGUITkInter的行嗎?

+0

我寧可不使用IronPython。你是否仍然知道你之前看過它的地方? – Reshure 2009-12-29 13:18:37

+1

立即使用TkInter。 – Reshure 2010-01-03 15:30:05

+0

重申,在這種情況下,你應該使用'ttk'模塊。見http://tkdocs.com/tutorial – 2010-01-03 22:00:15

2

您需要爲Python解釋器添加一個指定正確版本的ComCtl32.dll的並行清單。幸運的是,不需要改變解釋器可執行文件本身。

  • 創建一個名爲python.exe.manifest包含python.exe目錄文件。
  • 將下面的內容,在該文件中:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<assembly 
    xmlns="urn:schemas-microsoft-com:asm.v1" 
    manifestVersion="1.0"> 
<assemblyIdentity 
    processorArchitecture="x86" 
    version="5.1.0.0" 
    type="win32" 
    name="python.exe"/> 
<description>Python</description> 
<dependency> 
    <dependentAssembly> 
    <assemblyIdentity 
     type="win32" 
     name="Microsoft.Windows.Common-Controls" 
     version="6.0.0.0" 
     publicKeyToken="6595b64144ccf1df" 
     language="*" 
     processorArchitecture="x86"/> 
    </dependentAssembly> 
</dependency> 
</assembly> 

您可能想python.exe.manifest複製到pythonw.exe.manifest了。

+0

謝謝,但這似乎並沒有工作。什麼都沒發生。 – Reshure 2009-12-28 12:32:09

+0

如果腳本在PythonWin.exe下運行,那麼清單應該是PythonWin.exe.manifest。 – tzot 2009-12-28 19:31:56

+1

我從python.exe(ActivePython 3.1)運行 – Reshure 2009-12-28 19:38:31

0

您是否嘗試過使用'winxpgui'模塊而不是'win32gui'模塊?

我不確定是否存在'winvistagui'或'win7gui'模塊,但'winxpgui'確實存在並且可能有效,因爲它包含了一個清單。

+0

我試過winxp,但沒有奏效。 – Reshure 2010-01-03 09:00:49

相關問題