Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
#14: PyGTK themes do not work for frozen executables
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
PyInstaller Ticket  
View profile  
 More options Nov 2, 1:16 pm
From: "PyInstaller Ticket" <t...@pyinstaller.org>
Date: Mon, 02 Nov 2009 18:16:52 -0000
Local: Mon, Nov 2 2009 1:16 pm
Subject: Re: [Pyinstaller] #14: PyGTK themes do not work for frozen executables
#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


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
PyInstaller Ticket  
View profile  
 More options Nov 2, 1:24 pm
From: "PyInstaller Ticket" <t...@pyinstaller.org>
Date: Mon, 02 Nov 2009 18:24:12 -0000
Local: Mon, Nov 2 2009 1:24 pm
Subject: Re: [Pyinstaller] #14: PyGTK themes do not work for frozen executables
#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 forgot to say that I had to use the following code to load my theme:

 {{{
 import os, gtk
 try:

     basedir = os.environ['_MEIPASS2']

 except KeyError:

     basedir = sys.path[0]

 #Use embedded gtkrc
 gtkrc = os.path.join(basedir, 'gtkrc')
 gtk.rc_set_default_files([gtkrc])
 gtk.rc_reparse_all_for_settings(gtk.settings_get_default(), True)
 }}}

 To use it, save the code into a file named 'useGTK.py' and add the path to
 this file to ANALYSIS

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


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google