Re: [pygtk] gir1.2-gtk-2.0 and gir1.2-gtk-3.0 together

2011-06-17 Thread Marko Tasic
Giuseppe,

Simply require needed version of typelib, and then import it:
import gi
gi.require_version('Gtk', '2.0')
from gi.repository import Gtk

But, you cannot mix 2.0 and 3.0 modules.

Regards,
Marko Tasic


On Thu, Jun 16, 2011 at 8:17 PM, Giuseppe Penone  wrote:

> Hi all,
>
> I'm trying (like many others) to port code from pygtk2 to gi.
>
> I'm running ubuntu 11.04, I first had only gir1.2-gtk-2.0 and, running the
> following lines:
>
> from gi.repository import Gtk
> print Gtk
>
> I get  '/usr/lib/girepository-1.0/Gtk-2.0.typelib'>
>
> then I install also gir1.2-gtk-3.0 (together with gtk3), and running the
> same lines I get:
>
>  '/usr/lib/girepository-1.0/Gtk-3.0.typelib'>
>
> so my question is, how can I point to a Gtk version when both 2 and 3 are
> installed?
> Cheers,
> Giuseppe.
>
> ___
> pygtk mailing list   pygtk@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] PROBLEM: gtkwarning: gdk_property_change: assertion 'window != NULL' failed Options

2011-05-22 Thread Marko Tasic
Peter,

Your code runs perfectly fine on my machine. I have installed: ArchLinux
x86_64, CPython 2.7.1, pygtk 2.24.0 and gtk 2.24.4.

Can you tell us more about your environment?

Regards,
Marko Tasic


On Sun, May 22, 2011 at 9:43 PM, Peter Irbizon wrote:

> hello guys,
>
> please, I need help. I am new to pygtk and python and in my .py file I am
> getting error: gtkwarning: gdk_property_change: assertion 'window != NULL'
> failed
>
> this error occurs when I right click on textview and select cut/paste/copy.
> What am I doing wrong? thank you in advance.
>
>
> my xaa.py code looks like:
> import sys
> import traceback
> import pygtk
> pygtk.require("2.0")
> import gtk
> import gobject
> class jednoduchy_textovy_prohlizec ():
>   def __init__(self):
>   self.okno = gtk.Window()
>   self.okno.set_title("TextovĂ˝ editor")
>   self.okno.set_border_width(10)
>
>   # Editor
>   self.textovy_buffer = gtk.TextBuffer()
>   self.textovy_prohlizec = gtk.TextView(self.textovy_buffer)
>   self.posuvnikove_okno = gtk.ScrolledWindow()
>   self.posuvnikove_okno.set_policy(gtk.POLICY_AUTOMATIC,
> gtk.POLICY_AUTOMATIC)
>
> self.posuvnikove_okno.add_with_viewport(self.textovy_prohlizec)
>
>   self.vbox = gtk.VBox(False, 5)
>   self.vbox.pack_end(self.posuvnikove_okno)
>
>   self.okno.add(self.vbox)
>   self.okno.show_all()
>
>   self.okno.connect("destroy", gtk.main_quit)
>
> if __name__ == "__main__":
>   aplikace = jednoduchy_textovy_prohlizec()
>   gtk.main()
>
> ___
> pygtk mailing list   pygtk@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] pygtk Digest, Vol 99, Issue 17

2011-05-21 Thread Marko Tasic
Shrihari,

Try to install on Windows XP: Microsoft Visual C++ 2005, 2008, 2010
Redistributable Packages for x86.

Then run your application. If it works, then you can copy missing DLLs
(msvcr90.dll, etc) from them in your application directory (but it is not
suggested), else there is something else missing.

Regards,
Marko Tasic


On Sat, May 21, 2011 at 8:25 PM, Shrihari Sankaran wrote:

>  Hi,
>>> It is hard to see whats going on, but I can suggest to
>>> use some debugger like  ollydbg (http://www.ollydbg.de/[1]),
>>> or Process Monitor
>>> (http://technet.microsoft.com/en-us/sysinternals/bb896645[2]), to
>>> see what DLL it tries to
>>> load.
>>>
>>
>> depends.exe (http://dependencywalker.com/) also does a great job hunting
>> down these types of problems, espesially when using it's profiler...
>>
>> mvg,
>> Dieter
>>
>
> I tried using the dependency walker. It showed me a list of missing DLL
> files (here: http://imageshack.us/photo/my-images/839/error2j.jpg/ and
> also msvcr90.dll). I copied all those files from my original Windows 7
> directory to the "dist" directory. I then ran this copy on my XP machine.
> Again, same error. So I tried dependency walker again and got this:
> http://imageshack.us/photo/my-images/135/error3hf.jpg/
>
> Should i keep adding DLLs like this till the program works correctly ? Or
> is there a better and proper way to fix this ?
>
> Thanks,
> Shrihari
>
>
> ___
> pygtk mailing list   pygtk@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] Windows binary not running on XP

2011-05-20 Thread Marko Tasic
Hi,

It is hard to see whats going on, but I can suggest to use some debugger
like  ollydbg (http://www.ollydbg.de/), or Process Monitor (
http://technet.microsoft.com/en-us/sysinternals/bb896645), to see what DLL
it tries to load.

I usually find missing two DLLs: libxml2-2.dll and *iconv*.dll

Regards,
Marko Tasic


On Fri, May 20, 2011 at 9:22 PM, Shrihari Sankaran wrote:

> Hello,
>
> I recently built a pygtk application. The app runs completely when i invoke
> using "python app.py". So, I proceeded to build Windows binary with py2exe.
> The contents of my setup.py are below:
>
>
> from distutils.core import setup
> import py2exe
> import glob
> opts = {
> "py2exe": {
> "includes": "pango,atk,gobject",
> "dll_excludes": [
> "iconv.dll","intl.dll","libatk-1.0-0.dll",
> "libgdk_pixbuf-2.0-0.dll","libgdk-win32-2.0-0.dll",
> "libglib-2.0-0.dll","libgmodule-2.0-0.dll",
> "libgobject-2.0-0.dll","libgthread-2.0-0.dll",
> "libgtk-win32-2.0-0.dll","libpango-1.0-0.dll",
> "libpangowin32-1.0-0.dll"],
> }
> }
> setup(
> name = "Movie Monkey",
> description = "A simple light-weight movie manager",
> version = "1.0",
> windows = [
> {"script": "movie_monkey.py",
> "icon_resources": [(1, "movie_monkey.ico")]
> }
> ],
> options={
> 'py2exe': {
> 'packages':'encodings',
>  'includes': 'cairo, pango, pangocairo, atk, gobject, gio',
> }
> },
> data_files=[("movie_monkey.glade"),
> ("res", glob.glob("res/*.png")),
> ("logo.png")
> ],
> )
>
> The binary worked fine on the machine I built it on (Windows 7). It also
> worked fine on other Windows 7 machines. However, when i tried to run it on
> an Windows XP machine, i got the following error:
>
> Traceback (most recent call last):
>> File "movie_monkey.py", line 5, in 
>> File "gtk\__init__.pyc", line 40, in 
>> File "gtk\_gtk.pyc", line 12, in 
>> File "gtk\_gtk.pyc", line 10, in __load
>> ImportError: DLL load failed: The specified procedure could not be found.
>
>
> Any Idea what I'm doing wrong here?
>
> Thanks,
> Shrihari
>
> ___
> pygtk mailing list   pygtk@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] Need help with pygtk and gtk...under Windows XP

2011-03-13 Thread Marko Tasic
I also remember that I had problems without restarting Windows after setting
new PATH environment variable.

Regards,
Marko Tasic


On Sun, Mar 13, 2011 at 11:16 AM, Dieter Verfaillie <
diet...@optionexplicit.be> wrote:

> Hi,
>
> If you simply want to use PyGTK as soon as possible, you
> might be interested in the All-in-one installer:
> http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.22/
> All you need to do is to install
> "pygtk-all-in-one-2.22.6.win32-py2.7.msi" after you've
> installed Python 2.7. That's it :)
>
> There's also a "pygtk-all-in-one.README" file that explains
> some common pitfalls and also the more advanced usage of
> the installer.
>
> If, on the other hand, you want to manage your own GTK+
> environment combined with the separate pycairo/pygobject/pygtk
> installers, read below...
>
> On 13/03/2011 10:43, Catalin wrote:
> > Hi
> > I try to make working pygtk and gtk under python27.
> > I read tutorials and i set gtk with this:
> > I add on enviroment path vars : C:\gtk\bin
>
> Make sure it comes before all other directories that might
> contain (part of) a GTK+ environment on your PATH. Be aware
> this might just as well break other software that requires
> their own GTK+ version to be the first picked up from PATH.
> (that's why the all-in-one installer does not need you to
> configure the PATH environment variable, it is taken care
> off at runtime...)
>
> > C:\gtk\bin>pkg-config --cflags gtk+-2.0
> > -mms-bitfields -IC:/gtk/include/gtk-2.0 -IC:/gtk/lib/gtk-2.0/include
> -IC:/gtk/in
> > clude/atk-1.0 -IC:/gtk/include/cairo -IC:/gtk/include/gdk-pixbuf-2.0
> -IC:/gtk/in
> > clude/pango-1.0 -IC:/gtk/include/glib-2.0 -IC:/gtk/lib/glib-2.0/include
> -IC:/gtk
> > /include -IC:/gtk/include/freetype2 -IC:/gtk/include/libpng14
>
> Not really interesting unless you want to compile a C program
> that uses GTK+. Try pkg-config --list-all to get a list of
> installed "packages".
>
> > This is the errors i got:
> >
> >>>> import pygtk
> >>>> import gtk
> > Traceback (most recent call last):
> >   File "", line 1, in 
> >   File "C:\Python27\lib\site-packages\gtk-2.0\gtk\__init__.py", line 30,
> in  > ule>
> > import gobject as _gobject
> >   File "C:\Python27\lib\site-packages\gtk-2.0\gobject\__init__.py", line
> 26, in
> > 
> > from glib import spawn_async, idle_add, timeout_add,
> timeout_add_seconds, \
> >   File "C:\Python27\lib\site-packages\gtk-2.0\glib\__init__.py", line 22,
> in  > dule>
> > from glib._glib import *
> > ImportError: DLL load failed: The specified procedure could not be found.
>
> You can trace missing dependencies like this with depends.exe
> (http://www.dependencywalker.com/). It will tell you what .dll files
> you're missing (but it's still up to you to find out what package
> provides those .dll files).
>
> mvg,
> Dieter
> ___
> pygtk mailing list   pygtk@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] Need help with pygtk and gtk...under Windows XP

2011-03-13 Thread Marko Tasic
Catalin,

Which version of pygtk and gtk (win32 bundle?) do you use?

Regards,
Marko Tasic


On Sun, Mar 13, 2011 at 10:43 AM, Catalin  wrote:

> Hi
> I try to make working pygtk and gtk under python27.
> I read tutorials and i set gtk with this:
> I add on enviroment path vars : C:\gtk\bin
>
> C:\gtk\bin>pkg-config --cflags gtk+-2.0
> -mms-bitfields -IC:/gtk/include/gtk-2.0 -IC:/gtk/lib/gtk-2.0/include
> -IC:/gtk/in
> clude/atk-1.0 -IC:/gtk/include/cairo -IC:/gtk/include/gdk-pixbuf-2.0
> -IC:/gtk/in
> clude/pango-1.0 -IC:/gtk/include/glib-2.0 -IC:/gtk/lib/glib-2.0/include
> -IC:/gtk
> /include -IC:/gtk/include/freetype2 -IC:/gtk/include/libpng14
>
> C:\gtk\bin>
>
> This is the errors i got:
>
> >>> import pygtk
> >>> import gtk
> Traceback (most recent call last):
>  File "", line 1, in 
>  File "C:\Python27\lib\site-packages\gtk-2.0\gtk\__init__.py", line 30, in
>  ule>
>import gobject as _gobject
>  File "C:\Python27\lib\site-packages\gtk-2.0\gobject\__init__.py", line 26,
> in
> 
>from glib import spawn_async, idle_add, timeout_add,
> timeout_add_seconds, \
>  File "C:\Python27\lib\site-packages\gtk-2.0\glib\__init__.py", line 22, in
>  dule>
>from glib._glib import *
> ImportError: DLL load failed: The specified procedure could not be found.
> >>>
>
> Also , I think it is need to make something with pygtk and gtk ,
> because I saw on internet is
> many tasks about pygtk and gtk  and errors .
> Can you help me with one solution to make working pygtk and gtk .
>
>
> --
> My sites:
> http://catalin-festila.blogspot.com -about me
> http://tv.free-tutorials.org - video tutorials
> http://python-catalin.blogspot.com - my python blog
> ___
> pygtk mailing list   pygtk@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] PyGtk for Python 3?

2011-03-04 Thread Marko Tasic
On Linux everything works as expected, but there is no Python 3.x build for
Windows, so I'm forced to use ether Python 2.x build or "old" PyGtk.

Marko Tasic


On Fri, Mar 4, 2011 at 1:25 AM, Robert Park  wrote:

> On Thu, Mar 3, 2011 at 3:25 PM, Greg Ewing 
> wrote:
> > The web site says "At this point we need documentation, stability
> > and users!" which sounds like it's not ready for prime time yet.
>
> That's old news. There was a big hackfest recently and for the most
> part pygobject has been brought up to the standards of PyGtk. I've
> been using it with great success for many months, and so have many
> other people.
>
> Just use it, and if you happen to find problems, report them.
>
>
> --
> http://exolucere.ca
> ___
> pygtk mailing list   pygtk@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/