Re: [pygtk] new development snapshot

2000-05-09 Thread James Henstridge

On Tue, 9 May 2000, Tom Cato Amundsen wrote:

> James Henstridge wrote:
> > This is due to the use of ExtensionClass.  I am not sure how to fix this
> > properly.  This is mentioned in the ExtensionClass.stx file included in
> > the tarball.  You can get your code to work with:
> > DataStorage.__dict__['__init__'](self, name)
> Thanks, I can live with this. Anyway the code should have been fixed to
> not mix gui and data anyway.
> 
> One last question about pre0.7.0, should we expect many
> incompatibilities.

There will be some.  I had to change some keyword arguments in some of the
examples because the argument names now match those found in the gtk+
header files.

> 
> One thing, many constructors in gtk.py, like GtkAdjustment has default
> values,
> (at least now) 0.7.0 has not. This is just fine for me since it is
> closer to
> the C version.

Part of the reason why all functions had default values for the
constructors was to get the GtkWhatever(_obj=...) call to work with all
objects.  This isn't needed now, but having sensible defaults on some
objects would probably be a good idea.

> 
> But will for example GtkCheckButton.active work in 0.7.0 final? Right
> now
> I need to use get_active() method. (Ok this is not close to C, but I
> like it...)

I guess that is a bug.  It can be fixed by editing gtk.defs and adding the
extra field to GtkToggleButton and recompiling.  I will add this.  There
are still a few bugs in the way you can access class attributes in the new
pygtk (eg. if a class defines new attributes, you can't get to any of the
attributes in a parent class).

> 
> Tom Cato
> 

James.

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


-
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] new development snapshot

2000-05-09 Thread Tom Cato Amundsen

James Henstridge wrote:
> This is due to the use of ExtensionClass.  I am not sure how to fix this
> properly.  This is mentioned in the ExtensionClass.stx file included in
> the tarball.  You can get your code to work with:
> DataStorage.__dict__['__init__'](self, name)
Thanks, I can live with this. Anyway the code should have been fixed to
not mix gui and data anyway.

One last question about pre0.7.0, should we expect many
incompatibilities.

One thing, many constructors in gtk.py, like GtkAdjustment has default
values,
(at least now) 0.7.0 has not. This is just fine for me since it is
closer to
the C version.

But will for example GtkCheckButton.active work in 0.7.0 final? Right
now
I need to use get_active() method. (Ok this is not close to C, but I
like it...)

Tom Cato
-
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] new development snapshot

2000-05-09 Thread James Henstridge

On Tue, 9 May 2000, Tom Cato Amundsen wrote:

> In my eartraining program, I have the (bad?) habit of using multiple
> inheritance:
> 
> class ChordBox(gkt.GtkHBox, DataStorage):
>   def __init__(self, name):
>   gtk.GtkHBox.__init__(self)
>   DataStorage.__init__(self, name)
>   ...
>   ...
> 
> With 0.7.0-unstable-dont-use, I get:
> 
> DataStorage.__init__(self, name)
> TypeError: unbound method must be called with class instance 1st
> argument
> 
> Should I convert to having a DataStorage variable in ChordBox, or will
> this
> be possible 0.7.0 is finished?

This is due to the use of ExtensionClass.  I am not sure how to fix this
properly.  This is mentioned in the ExtensionClass.stx file included in
the tarball.  You can get your code to work with:
DataStorage.__dict__['__init__'](self, name)

It doesn't look as pretty, but it does work.  The difference is that
DataStorage.__init__ is an unbound method that requires an Instance type
as its first argument (and in your case, self would be of type ChordBox),
while DataStorage.__dict__['__init__'] is just a plain function.

> 
> Tom Cato
> 

James.

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


-
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] new development snapshot

2000-05-09 Thread Tom Cato Amundsen

In my eartraining program, I have the (bad?) habit of using multiple
inheritance:

class ChordBox(gkt.GtkHBox, DataStorage):
def __init__(self, name):
gtk.GtkHBox.__init__(self)
DataStorage.__init__(self, name)
...
...

With 0.7.0-unstable-dont-use, I get:

DataStorage.__init__(self, name)
TypeError: unbound method must be called with class instance 1st
argument

Should I convert to having a DataStorage variable in ChordBox, or will
this
be possible 0.7.0 is finished?

Tom Cato
-
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] new development snapshot

2000-05-08 Thread James Henstridge

On Mon, 8 May 2000, Tom Cato Amundsen wrote:

> James Henstridge wrote:
> > 
> > I have put up another tarball of the new extension class based pygtk.  It
> > is available at:
> >   ftp://ftp.daa.com.au/pub/james/python/pygtk-0.7.0-unstable-dont-use.tar.gz
> It seems like you missed gtk/gdk.defs. Only gtk.defs and
> gtk-extrafuncs.defs is
> mentioned as EXTRA_DIST in gtk/Makefile.am.

Alright.  The updated tarball is now on the ftp site.  I even ran make
distcheck on it, so it should build.  As I said in the first message, it
is still not finished, so don't be surprised if things don't quite work
right (I would like some feedback though).

James.

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


-
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] new development snapshot

2000-05-08 Thread James Henstridge

On Mon, 8 May 2000, Tom Cato Amundsen wrote:

> James Henstridge wrote:
> > 
> > I have put up another tarball of the new extension class based pygtk.  It
> > is available at:
> >   ftp://ftp.daa.com.au/pub/james/python/pygtk-0.7.0-unstable-dont-use.tar.gz
> It seems like you missed gtk/gdk.defs. Only gtk.defs and
> gtk-extrafuncs.defs is
> mentioned as EXTRA_DIST in gtk/Makefile.am.

My mistake.  I will put up a replacement snapshot soon.  Until then, you
can grab the files from CVS.

> 
> Tom Cato

James.

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


-
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] new development snapshot

2000-05-08 Thread Tom Cato Amundsen

James Henstridge wrote:
> 
> I have put up another tarball of the new extension class based pygtk.  It
> is available at:
>   ftp://ftp.daa.com.au/pub/james/python/pygtk-0.7.0-unstable-dont-use.tar.gz
It seems like you missed gtk/gdk.defs. Only gtk.defs and
gtk-extrafuncs.defs is
mentioned as EXTRA_DIST in gtk/Makefile.am.

Tom Cato
-
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



[pygtk] new development snapshot

2000-05-08 Thread James Henstridge

I have put up another tarball of the new extension class based pygtk.  It
is available at:
  ftp://ftp.daa.com.au/pub/james/python/pygtk-0.7.0-unstable-dont-use.tar.gz

As before, it is not yet ready to replace the 0.6.x versions of pygtk, but
it is getting better.  You will probably find that a lot of your programs
just work (or almost work) with the new code.

If you want to run a program without installing the test release, remember
to import the ltihooks module before gtk (this makes sure it finds the
extensions correctly).

It is still not complete, but it is getting there.

James.

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


-
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]