[pygtk] Compiling with MinGW under Windows

2002-12-03 Thread Rene Olsthoorn
Hello,
I downloaded MinGW and MSYS for Windows, and started the ./configure script of 
pygtk-1.99.13. The Configure comes pretty far. It correctly checks the python version, 
but it stops with an error because the Python headers could not be found.
The INCLUDE environment variable points to my Python/include directory, so I'm 
wandering what might be the problem.
Any of you experience in using MinGW to compile PyGTK-1.99.13?

Greets and best whishes,
René Olsthoorn.

-- 
__
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

One click access to the Top Search Engines
http://www.exactsearchbar.com/mailcom

___
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] Frozen pygtk code

2002-12-03 Thread Christian Reis
On Mon, Dec 02, 2002 at 05:17:33PM +0100, Roberto Cavada wrote:
 Has someone ever tried to freeze pygtk code, in order to produce a 
 more easily distributable code? 

Never did it. Do you mean for Win32, or using the freeze tools that come
with Python source?

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] GdkRectangles

2002-12-03 Thread Christian Reis
On Mon, Dec 02, 2002 at 06:15:15PM -0800, David M. Cook wrote:
 On Mon, Dec 02, 2002 at 12:52:58AM -0800, David M. Cook wrote:
 
  Are GdkRectangles always represented by 4-tuples in pygtk?  The reason I ask
  is that functions like TreeView.get_cell_area() and
  TreeView.get_background_area seem to want GdkRectangles as input/output
  parameters.  Immutable types don't make good input/output parameters.
 
 Sorry, I figured this out with a little introspection.  I think I knew this
 at one time and forgot it.

What was the secret?

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] Frozen pygtk code

2002-12-03 Thread Roberto Cavada
On Tuesday 03 December 2002 11:49, Christian Reis wrote:
  Has someone ever tried to freeze pygtk code
 Never did it. Do you mean for Win32, or using the freeze tools that
 come with Python source?
Second one. 
We're developing a GUI application (http://nusmv.irst.itc.it/gnusmv),  
fully based on python and gtk, both for win32 and unixes. 
Since pygtk2, gtk2, glade, etc., are not installed (or easily 
installable) on most of current unix distributions, currently the 
installation phase could be really bother and complex for the user.  
We assume that distributing frozen code could simplify several 
dependencies... 
rob
___
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] Compiling with MinGW under Windows

2002-12-03 Thread Cedric Gustin

Hi Rene,

At 05:00 AM 12/3/2002 -0500, you wrote:

Hello,
I downloaded MinGW and MSYS for Windows, and started the ./configure 
script of pygtk-1.99.13. The Configure comes pretty far. It correctly 
checks the python version, but it stops with an error because the Python 
headers could not be found.
The INCLUDE environment variable points to my Python/include directory, so 
I'm wandering what might be the problem.
Any of you experience in using MinGW to compile PyGTK-1.99.13?

LDFLAGS=-L/path/to/your/python/lib -lpython22 CFLAGS=-mcpu=pentium 
-mms-bitfields -O2 CPPFLAGS=-I/path/to/your/python/headers ./configure 
--prefix=/target --build=i386-pc-mingw32

make

or use my binaries

http://www.mapr.ucl.ac.be/~gustin/win32_ports/PyGtk-1.99.13.win32.exe

Cedric 

___
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] win32 port of pygtk

2002-12-03 Thread Cedric Gustin

I recompiled pygtk-0.6.11 for python 2.2 with the latest gtk+-1.3 DLLs . 
Could somebody try it ?

http://www.mapr.ucl.ac.be/~gustin/win32_ports/PyGtk-0.6.11.win32.exe

Cedric


Could you give me the instructions to compile both?, the problem
is I've just finished an app on pygtk-0.6.9.

How dificult is it to recopile pygtk-0.6.9 for python 2.2 when you
already have it for python 2.1?


___
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] Frozen pygtk code

2002-12-03 Thread Christian Reis
On Tue, Dec 03, 2002 at 12:24:20PM +0100, Roberto Cavada wrote:
 We're developing a GUI application (http://nusmv.irst.itc.it/gnusmv),  
 fully based on python and gtk, both for win32 and unixes. 
 Since pygtk2, gtk2, glade, etc., are not installed (or easily 
 installable) on most of current unix distributions, currently the 
 installation phase could be really bother and complex for the user.  
 We assume that distributing frozen code could simplify several 
 dependencies... 

It could, but I don't know if freeze handles binary dependencies as you
want. I know the Win32 freeze tools by Gordon McMillan do, but I've
never tried to use them to bundle pygtk (since we have such good
installers anyway, it never appealed to much to me).

If you do manage, please post here to let us know.

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] GdkRectangles

2002-12-03 Thread David M. Cook
 What was the secret?

I spoke too soon.  I'm no closer to understanding how Rectangles are handled
by pygtk.  I was embarassed that I might be rehashing old ground, but there
is almost nothing on this subject in over 11M of pygtk list archives.  

gdk.Rectangle has a copy method.  Playing around a bit, you can get a
GdkRectangle by copying, say, Widget.allocation:

rect = somewidget.allocation.copy()

However, I tried passing this to TreeView.get_visible_rect, but the passed
in rect doesn't change.  I was able to get what I wanted (the first visible
row  col on the top left (origin) of the TreeView) with
TreeView.get_path_at_pos(0,0) (if you want the column number in the
callback, you'll need to attach an integer to ViewColumn at creation time;
there are still a few holes in the C-Gtk TreeView API.)

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] Frozen pygtk code

2002-12-03 Thread Cedric Gustin
At 12:24 PM 12/3/2002 +0100, Roberto Cavada wrote:

On Tuesday 03 December 2002 11:49, Christian Reis wrote:
  Has someone ever tried to freeze pygtk code
 Never did it. Do you mean for Win32, or using the freeze tools that
 come with Python source?
Second one.
We're developing a GUI application (http://nusmv.irst.itc.it/gnusmv),
fully based on python and gtk, both for win32 and unixes.
Since pygtk2, gtk2, glade, etc., are not installed (or easily
installable) on most of current unix distributions, currently the
installation phase could be really bother and complex for the user.
We assume that distributing frozen code could simplify several
dependencies...



On win32, you should give py2exe 
(http://starship.python.net/crew/theller/py2exe/) a try. It works with 
pygtk. Once your code is frozen, you can create an installer with Inno 
Setup for example. The gtk+-2.0 runtime environment is available here, also 
as a nice installer

http://www.dropline.net/jade/download.html

Cedric

___
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] FYI: PyGTK Tutorial updated

2002-12-03 Thread arjanmolenaar

 I've updated the PyGTK tutorial for PyGTK 1.99.x. The original tutorial 
 for PyGTK 0.6x is still available. You can find these and gzip'd 
 tarballs at:
 
 http://www.moeraki.com/pygtktutorial/index.html

Very complete! I think it's a good tutorial.

Only a few suggestions for a future version:
1. import pygtk; pygtk.require('2.0') should be used to use the right pygtk version.
2. Maybe a chapter about creating your own widgets, including the __gproperties__ and 
__gsignals__ class attributes and some things about overriding signals.

I am willing to help where I can.

Keep up the good work.

Regards,

Arjan



___
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] win32 multiplexing

2002-12-03 Thread John K Luebs
I have started playing around with pygtk2, and I am quite impressed.

I've decided to use GTK+ as a toolkit for operator interfaces.

Most of these programs a) will run on Windows b) do a lot of low
throughput I/O for data aquistion.

In Win32, multiplexing on file handles can be done, but it isn't the
same as throwing fds to poll.  
Instead, the premier waitable I/O objects (for char devices) are 
Events associated to an overlapped I/O operation. Interestingly, the
core glib main loop implementation supports this, but the IO Channel
mechanism does not (which is what input_add wraps)

My temporary solution to this is:

use gtk.idle_add to add a callback function describe below.
gtk.mainloop() # I have to get into a loop before I can use main_iteration_do

The callback function looks like this:

def real_main_loop():
gtk.idle_remove(rmlid) # remove myself
done = 0
while not done:
rc = win32event.MsgWaitForMultipleObjects()
# ... dispatch for handles goes here 
if rc == WAIT_OBJECT_0 + nevents:
while gtk.events_pending():
done = gtk.main_iteration_do(1)

gtk.main_quit() # leave the initial main loop

It's a little ugly and hackish. Could someone share something better?

On making it easier to do with pygtk:

Perusing through the glib I/O channel implementation for win32 it uses
its own thread formation and blocking I/O operations. This will not work
for handles that are opened for overlapped operation. The glib I/O
channel operations is what input_add wraps.

Although the glib I/O channel implemention won't help us, the notion of
a GPollFD and poll is transliterated into Event HANDLES and
MsgWaitForMultipleObjects, which is perfect.

If pygtk exposed the glib loop operations one could take advantage of
the multiplexing in glib for win32. This means wrapping the GSource type and
g_source_* functions in glib.

Then, one could sanely deal with character devices (like COM ports) and 
even sockets (you can create EVENTs that are tied to sockets). 
The drawback is that one would need a layer of windows'isms in their 
Python code and use win32all to some extent, but it is better than 
nothing until input_add works.

 -- jkl
___
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] GdkRectangles

2002-12-03 Thread Christian Reis
On Tue, Dec 03, 2002 at 04:09:53AM -0800, David M. Cook wrote:
  What was the secret?
 
 I spoke too soon.  I'm no closer to understanding how Rectangles are handled
 by pygtk.  I was embarassed that I might be rehashing old ground, but there
 is almost nothing on this subject in over 11M of pygtk list archives.  

Realize that PyGTK2 is rather recent, so few people have hacked
Rectangles before.

 gdk.Rectangle has a copy method.  Playing around a bit, you can get a
 GdkRectangle by copying, say, Widget.allocation:
 
 rect = somewidget.allocation.copy()

Can't you just use a 4-item tuple when a gdk.Rectangle is required?

 However, I tried passing this to TreeView.get_visible_rect, but the passed
 in rect doesn't change.  I was able to get what I wanted (the first visible

But it seems to take in tree coordinates. Did you use the allocation of
the tree widget?

Tree coordinates start at 0,0 for row 0 of the tree, and cover the
entire scrollable area of the tree.

 row  col on the top left (origin) of the TreeView) with
 TreeView.get_path_at_pos(0,0) (if you want the column number in the
 callback, you'll need to attach an integer to ViewColumn at creation time;
 there are still a few holes in the C-Gtk TreeView API.)

Hmm, you lost me here :-)

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] gtk.gdk.Colormap.alloc_color

2002-12-03 Thread Christian Reis
On Wed, Dec 04, 2002 at 09:05:52AM +1100, Simon Burton wrote:
 Anyway, i'd like to work more on this, and am looking for hints on the next step to 
take.
 Had a look at the CVS but no luck downloading it, let alone patching against.

First step is pulling CVS. What went wrong? (I hope you didn't think we
were going to guess ;)

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] GdkRectangles

2002-12-03 Thread Johan Dahlin
tis 2002-12-03 klockan 10.09 skrev David M. Cook:
  What was the secret?
 
 I spoke too soon.  I'm no closer to understanding how Rectangles are handled
 by pygtk.  I was embarassed that I might be rehashing old ground, but there
 is almost nothing on this subject in over 11M of pygtk list archives.  

It's very recent, added to cvs only 4 month ago.
You can find some information in bugzilla:
http://bugzilla.gnome.org/show_bug.cgi?id=74136

But it's mostly implementation details

-- 
Johan Dahlin [EMAIL PROTECTED]
Async Open Source

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