Re: [pygtk] Hello World || GtkWindow Not Defined

2003-02-05 Thread David M. Cook
On Wed, Feb 05, 2003 at 09:39:13PM -0500, Met @ Uber wrote:

> It says I'm running version (1, 99, 12).  I currently have these RPM's
> Do I need to upgrade?  

Latest pygtk release is 1.99.14.  That has most of the important additions
and fixes (there are a lot).  You may want to download it to look at the
ChangeLog.  However, the CVS version is just as easy to install, and there
is no risk in installing it as it gets installed to a separate gtk-2.0
directory.

export CVSROOT=':pserver:[EMAIL PROTECTED]:/cvs/gnome'
cvs login
cvs -z3 co gnome-python
cd gnome-python/pygtk
./autogen.sh --prefix /usr
make
make install

I prefer to put pygtk in /usr as I don't have to mess with PYTHONPATH then.
This puts pygtk in it's own directory, so it doesn't overwrite the RH files.
You then load it with

import pygtk; pygtk.require('2.0')
import gtk

Just leave out the top line to load the original version of the module.

Dave Cook
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] Hello World || GtkWindow Not Defined

2003-02-05 Thread Christian Reis
On Wed, Feb 05, 2003 at 09:39:13PM -0500, Met @ Uber wrote:
> Do I need to upgrade?  I thought these were the latest releases?  Either
> way, I'm still not sure why GtkWindow is not defined?

As Dave said, read the FAQ :-) The "Gtk" prefix was removed from the
widget name. You should now use gtk.Window instead. Just so you know,
you're using PyGTK-1.99 which I call PyGTK-2. The original PyGTK-0 used
the Gtk prefixes, which is why you're confused.

Redhat's version is okay, but if you have the guts to try CVS HEAD,
you'll be better off, since lots of bugs have been fixed.

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] Hello World || GtkWindow Not Defined

2003-02-05 Thread Met @ Uber
On Wed, 2003-02-05 at 20:44, David M. Cook wrote:
> On Wed, Feb 05, 2003 at 08:16:43PM -0500, Met @ Uber wrote:
> 
> > reporting the error that GtkWindow is not defined.  I have Gtk and PyGtk
> 
> Sounds like pygtk2 is getting loaded.  What does
> 
>   python -c 'import gtk; print gtk.pygtk_version'
> 
> print out?  See the pygtk FAQ for info on porting to pygtk2:
> 
>   http://www.async.com.br/faq/pygtk/index.py?req=all
> 
> Unless you specifically need it, there's not much reason to use the older
> pygtk .6 (why spend valuable time learning deprecated APIs?).  However, I'd
> get the latest version from CVS and gtk+ 2.2.1, as there have been tons of
> bug fixes since the versions in RH 8.
> 
> Dave Cook
>

It says I'm running version (1, 99, 12).  I currently have these RPM's
installed:

pygtk2-1.99.12-7
gtk2-2.0.6-8
pygtk2-devel-1.99.12-7
gtk+-devel-1.2.10-22
gtk2-devel-2.0.6-8
gtk+-1.2.10-22
pygtk2-libglade-1.99.12-7

Do I need to upgrade?  I thought these were the latest releases?  Either
way, I'm still not sure why GtkWindow is not defined?

Ideas?  Thanks in advance,

~ Metnetsky

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] Hello World || GtkWindow Not Defined

2003-02-05 Thread David M. Cook
On Wed, Feb 05, 2003 at 08:16:43PM -0500, Met @ Uber wrote:

> reporting the error that GtkWindow is not defined.  I have Gtk and PyGtk

Sounds like pygtk2 is getting loaded.  What does

  python -c 'import gtk; print gtk.pygtk_version'

print out?  See the pygtk FAQ for info on porting to pygtk2:

  http://www.async.com.br/faq/pygtk/index.py?req=all

Unless you specifically need it, there's not much reason to use the older
pygtk .6 (why spend valuable time learning deprecated APIs?).  However, I'd
get the latest version from CVS and gtk+ 2.2.1, as there have been tons of
bug fixes since the versions in RH 8.

Dave Cook
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



[pygtk] Hello World || GtkWindow Not Defined

2003-02-05 Thread Met @ Uber
I'm just getting started with PyGTK and have having some troubles right
off the bat.  I'm trying to run the following script but it keeps
reporting the error that GtkWindow is not defined.  I have Gtk and PyGtk
installed, what could I be missing?  I'm running on Redhat 8 with all
the latest packages.  Here's the following script I am trying.

#
from gtk import *

win = GtkWindow()

def main():
win.set_usize(300, 350)
win.connect("destroy", mainquit)
win.set_title("PyGTK Test")
win.show()
mainloop()

main()
#

Thanks in advance,

~ Matthew Metnetsky

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] PIL <-> PyGTK

2003-02-05 Thread Andreas Kostyrka
Am Mittwoch, 5. Februar 2003 09:09 schrieb James Henstridge:
> Not that I know of.  Note that the CVS version of pygtk might help.  If
> you have numpy, you can now get a reference to a numpy multidimensional
> array representing the pixel data in the pixbuf (MxNx3 or MxNx4
> depending on the presence of an alpha channel).  You can use this to
> edit the pixels of an existing pixbuf.
>
> I have also added wrappers for the draw_rgb_image, draw_rgb_32_image and
> draw_gray_image methods of the GdkDrawable class (which is the abstract
> base for windows and pixmaps), so if you can convert your PIL image to a
> pixel data string or buffer object, you could use them to display the
> image.
Well, for my uses it's probably enough to create a temporary file which I load 
again. 

Andreas
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] py2exe or simaliar for pygtk-1.9.x aps for win32

2003-02-05 Thread Cedric Gustin
At 05:03 PM 2/4/2003 -0400, Pablo Endres wrote:

Has anyone tryed py2exe or similar aplications to deploy pygtk apps
on windows?


Yes and it works fine


Please any recomendations would be nice.  If there are some 
tricks they would also
be apreciated.

No special recommendation. You might want to use the "ApplicationPath" 
trick described at

http://www.dropline.net/gtk/support.html

when creating a nice installer for your application (with Inno Setup for 
example).

Cedric

P.S. : Any feedback about the win32 port of pygtk with threading enabled ?

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] PIL <-> PyGTK

2003-02-05 Thread James Henstridge
Andreas Kostyrka wrote:


Hi!

Is there any "easy" and fast way to convert from PIL image objects to a 
pixbuf?
 

Not that I know of.  Note that the CVS version of pygtk might help.  If 
you have numpy, you can now get a reference to a numpy multidimensional 
array representing the pixel data in the pixbuf (MxNx3 or MxNx4 
depending on the presence of an alpha channel).  You can use this to 
edit the pixels of an existing pixbuf.

I have also added wrappers for the draw_rgb_image, draw_rgb_32_image and 
draw_gray_image methods of the GdkDrawable class (which is the abstract 
base for windows and pixmaps), so if you can convert your PIL image to a 
pixel data string or buffer object, you could use them to display the image.

I still plan to implement something like the pygtk-0.6.x draw_array() 
method for drawing a numpy array to a drawable, and a way to create a 
pixbuf from a numpy array.

James.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/