#14: PyGTK themes do not work for frozen executables
-------------------------+--------------------------------------------------
 Reporter:  openticket   |       Owner:  giovannibajo
     Type:  defect       |      Status:  new         
 Priority:  normal       |   Milestone:              
Component:  PyInstaller  |     Version:              
 Severity:  normal       |    Keywords:              
-------------------------+--------------------------------------------------

Comment(by MeV):

 I successfully added the MS-Windows theme (for better windows integration)
 to my application by using a code like this:

 {{{

 # First we have to know where gtk is installed, we get this from registry
 import _winreg
 import msvcrt
 try:
     k = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,
 'Software\\GTK2-Runtime')
 except EnvironmentError:
     print 'You must install the Gtk+ 2.2 Runtime Environment to run this
 program'
     while not msvcrt.kbhit():
         pass
     sys.exit(1)
 else:
     gtkdir = str(_winreg.QueryValueEx(k, 'InstallationDirectory')[0])
     gtkversion = str(_winreg.QueryValueEx(k, 'BinVersion')[0])

 #Then we want to go to the directory where the gtkrcfile is located
 gtkrc_dir = os.path.join('share', 'themes', 'MS-Windows', 'gtk-2.0')

 #Add gtkrc file to exe
 extra_datas = [ ('gtkrc', os.path.join(gtkdir, gtkrc_dir, 'gtkrc'),
 'DATA') ]

 #Add libwimp.dll to exe (needed for the MS-Windows theme)
 extra_binaries = [ (os.path.join(engines_dir, 'libwimp.dll'), \
                    os.path.join(gtkdir, engines_dir, 'libwimp.dll'),
 'BINARY') ]

 #Finally the EXE declaration should looks like this:
 exe = EXE( pyz,

           a.scripts,

           a.binaries + extra_binaries,

           a.zipfiles,

           a.datas + extra_datas,

           name = os.path.join('dist', 'myapp.exe'),
           icon = os.path.join('icon', 'myicon.ico'),

           debug = False,

           strip = False,

           upx = True,

           console = False )

 }}}

-- 
Ticket URL: <http://www.pyinstaller.org/ticket/14#comment:1>
Pyinstaller <http://www.pyinstaller.org>
PyInstaller Project

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pyinstaller?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to