Re: [pygtk] GnomeAbout, gnome.app_id and gnome.app_version

2000-03-13 Thread James Henstridge

That is the only way to explicitely set the program name and version.  In
a future version, it will probably require doing something like:
  import gnome.ui, gnome.whatever  # import all gnome components used ...
  gnome.init('program-name', 'version')

It is necessary to import gnome.ui before libglade if your interface uses
gnome widgets.

James.

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


On Mon, 13 Mar 2000, Mitch Chapman wrote:

> [Using gnome-python 1.0.52, libglade 0.12, and
> gnome-lib 1.0.14 -- admittedly old, but it came with Mandrake 6.1.]
> 
> I'm trying to figure out how to get an application's name
> and version to show up in its About dialog.
> 
> gnome/__init__.py handles the case where the application is
> run as a command whose name ends in .py[oc]? and appears to
> hardware the application version number to '0.0'.
> 
> So far I can see only one way to override these settings:
> 
> import gnome
> gnome.app_id = "SomeApp"
> gnome.app_version = "0.3 alpha"
> import gnome.ui
> 
> Is there a better way?
> 
> Along the same lines, I'm finding it necessary to import 
> gnome.ui before importing libglade.  Otherwise a segmentation
> fault occurs.  Paraphrasing (not in front of the development
> machine just now):
> 
> GnomeUI-CRITICAL **: file gnome-app.c: line 206 (gnome_app_new):
> assertion 'appname != NULL' failed.
> 
> Is it necessary to explicitly import gnome.ui before importing 
> libglade?
> 
> --
> Mitch Chapman
> [EMAIL PROTECTED]
> To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
> 

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



[pygtk] GnomeAbout, gnome.app_id and gnome.app_version

2000-03-13 Thread Mitch Chapman

[Using gnome-python 1.0.52, libglade 0.12, and
gnome-lib 1.0.14 -- admittedly old, but it came with Mandrake 6.1.]

I'm trying to figure out how to get an application's name
and version to show up in its About dialog.

gnome/__init__.py handles the case where the application is
run as a command whose name ends in .py[oc]? and appears to
hardware the application version number to '0.0'.

So far I can see only one way to override these settings:

import gnome
gnome.app_id = "SomeApp"
gnome.app_version = "0.3 alpha"
import gnome.ui

Is there a better way?

Along the same lines, I'm finding it necessary to import 
gnome.ui before importing libglade.  Otherwise a segmentation
fault occurs.  Paraphrasing (not in front of the development
machine just now):

GnomeUI-CRITICAL **: file gnome-app.c: line 206 (gnome_app_new):
assertion 'appname != NULL' failed.

Is it necessary to explicitly import gnome.ui before importing 
libglade?

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



Re: [pygtk] Anti-aliasing ?

2000-03-13 Thread Torsten Landschoff

Hi! 

On Mon, Mar 13, 2000 at 02:05:39PM +0100, Hrvoje Niksic wrote:

> > What version of gnome-python do you have installed on your system?
> 
> 1.0.50-3 (Debian).

Hmm, does anybody know if this feature is needed by a lot of programs?
In that case please file an important bug against python-gnome. I am 
working on new packages but they will not get into potato unless they
fix a release critical bug. And filing such a bug myself would look 
ugly at least ;)

cu
Torsten

-- 
Torsten Landschoff   Bluehorn@IRC   <[EMAIL PROTECTED]>
   Debian Developer and Quality Assurance Committee Member
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] Anti-aliasing ?

2000-03-13 Thread François Pinard

Bernhard Herzog <[EMAIL PROTECTED]> écrit:
> François Pinard <[EMAIL PROTECTED]> writes:
> > Matt Wilson <[EMAIL PROTECTED]> écrit:

> > > The easiest way to do this by far is to use the canvas.  [...]
> > > The canvas does all this for you.

> > Thanks for the example, Matt, but this is not pure `pygtk' (or GDK)
> > anymore, if it needs `gnome.ui' and GnomeCanvas.

> I don't think there's a way to do what you want in pure pygtk.

I guess you are right.  I just played with GIMP a bit, and indeed, I did
not see anti-aliased lines in it.  The GIMP goal is images, and lines are
only used in interaction tools.  While I hope that `pygtk' gives access
to the whole GTK/GDK, it does not have to provide what these do not have!

By the way, I may sometimes look like moaning, but do not read me that way.
I'm quite satisfied with `pygtk' so far.  I observed a few glitches (memory
leaks, slight problems in some interfaces), but nothing serious that would
prevent immediate usage.  Problems were surely reported and are likely solved
in later versions.  I may not be running the latest/greatest one, but as it
stands, `pygtk' looks quite solid to me already, and I enjoy it a great deal.
This is a blessing for me, and I'm grateful to James and his collaborators.

> FWIW, the development versions of Sketch [...]

I saved a few messages about Sketch already, and maybe the time would be
right for me to give it a good look.  It sounds interesting and appealing.

> > So, I would like to know if/how I can, using GTK and GDK, and the `pygtk'
> > interface to both, create and handle an alpha channel [...]

With some luck, I'll stumble on solutions while pursuing my study.
Of course, early hints are welcome.  I'll do my homework, anyway :-).

 Keep happy, all.  It's fun being here!

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard


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



[pygtk] how to modify canned dialogs?

2000-03-13 Thread gry

[pygtk-0.6.4, gtk+-1.2.6, python-1.5.2]
[BTW, I love pygtk!  It's saved me many days of gruelling c++/motif hacking...]

I repeatedly come up against this problem:

I want to pop up a dialog, either just a message or request for some
input.  But, I want something slightly different than the (nicely)
canned gtkextra message_box, or input_box.  E.g. I want to force one of
the input_box's buttons to be the default, or I want to change the
justification of the message in the label of a message_box.

I know I could write my own slightly different copy of
gtkextra.message_box, or gtkextra.input_box, possibly needing to
derive some new object from _MessageBox, but is there some nicer way
without duplicating code?  I've never used rc files or styles -- would
that help?


George Young,  Rom. L-204   [EMAIL PROTECTED]
MIT Lincoln Laboratory
244 Wood St.
Lexington, Massachusetts  02420-9108(781) 981-2756
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] Anti-aliasing ?

2000-03-13 Thread Bernhard Herzog

François Pinard <[EMAIL PROTECTED]> writes:

> Matt Wilson <[EMAIL PROTECTED]> écrit:
> 
> > The easiest way to do this by far is to use the canvas.  [...]  The canvas
> > does all this for you.
> 
> Thanks for the example, Matt, but this is not pure `pygtk' (or GDK) anymore,
> if it needs `gnome.ui' and GnomeCanvas.

I don't think there's a way to do what you want in pure pygtk.

[...]
> So, I would like to know if/how I can, using GTK and GDK, and the `pygtk'
> interface to both, create and handle an alpha channel, and feel able do
> anti-alias myself if I want to (that is, if GTK has no provision for it).

Well, since doing it yourself probably requires a C-module, you might as
well sue libart for anti-aliased rendering. libart is the rendering
library for the anti-aliased gnome canvas and quite independent from
gnome.

FWIW, the development versions of Sketch contain some python-bindings
for libart that can render into libart rgb buffers and even into PIL
images (including alpha channels, but I haven't really tested that).
These bindings are somewhat sketch specific, though, so it might not be
all that easy to adapt them to a different application.

-- 
Bernhard Herzog   | Sketch, a drawing program for Unix
[EMAIL PROTECTED]  | http://sketch.sourceforge.net/
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] Anti-aliasing ?

2000-03-13 Thread François Pinard

Matt Wilson <[EMAIL PROTECTED]> écrit:

> > The code below shows the case of a line needing anti-aliasing.
> > Would someone knowledgeable tell me if/how I can, within `pygtk',
> > produce an anti-aliased line, or else (:-), how I could handle an
> > alpha channel for later display?

> The easiest way to do this by far is to use the canvas.  [...]  The canvas
> does all this for you.

Thanks for the example, Matt, but this is not pure `pygtk' (or GDK) anymore,
if it needs `gnome.ui' and GnomeCanvas.

When things like Gnome get in the picture, the mix of versions to use is
never new and fine tuned enough.  As I wrote a few days ago, I would like to
stay oriented towards applications, without being drawn into UI development.
This would be much prematurate for me, as I still have a lot to learn first.
Moreover, as a proof by example, GIMP surely does a great deal successfully
while relying on GTK, without resorting to Gnome libraries.

So, I would like to know if/how I can, using GTK and GDK, and the `pygtk'
interface to both, create and handle an alpha channel, and feel able do
anti-alias myself if I want to (that is, if GTK has no provision for it).

> canvas = GnomeCanvas(aa=TRUE)

I tried your example here (using the software as found within SuSE 6.2), and
even if the line displayed is undoubtly different from what I got so far, it
seems to try to provide anti-alias by some strange use of dark points here
and there, all along.  Or maybe, presumably, it is a side effect of poor
colour map allocation (here, this is a 8-bit depth display).  I'm seeking
for more traditional anti-aliasing, where line pixel colours should be
picked from a ramp between the background and the foreground colour.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard


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



Re: [pygtk] Anti-aliasing ?

2000-03-13 Thread Hrvoje Niksic

James Henstridge <[EMAIL PROTECTED]> writes:

> What version of gnome-python do you have installed on your system?

1.0.50-3 (Debian).
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



[pygtk] Re: pygtk checkins

2000-03-13 Thread Frederic Gobry

> That would be a good idea.

Done.

On another topic, I think having a version number available as a (eventually
set of) python variable would be a nice thing: I would enjoy being able to
test it during the configuration of my own packages, so that I can issue
explicit error messages (like the ones you get if your version of Gtk is too
old).

Frédéric
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



[pygtk] ANNOUNCE: pygtk-0.6.5 and gnome-python-1.0.52

2000-03-13 Thread James Henstridge

I have just put out pygtk-0.6.5 and gnome-python-1.0.52.  Here is a list
of some of the changes:

pygtk:
- more reference leaks fixed.
- crashes when changing window properties with 16 or 32 bit data
  formats fixed.
- some libglade wrapper fixes.
- various other fixes.
gnome-python:
- hopefully fixed the gettext.py module for big endian machines.
- fixed small GnomeMDIGenericChild wrapper problem (from Federic
  Gorby)
- small GnomeUIInfo handling bug fixed (again from Federic).

gnome-python is available from:
  ftp://ftp.gnome.org/pub/GNOME/stable/sources/gnome-python/
pygtk will soon be available from:
  ftp://ftp.gtk.org/pub/gtk/python/

I have also uploaded the new versions to ftp.python.org, and they are
available from my personal ftp site (please use a mirror though).

BTW, I will be at GUADEC (www.guadec.enst.fr) later on this week.

James.

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


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



Re: [pygtk] Anti-aliasing ?

2000-03-13 Thread James Henstridge

What version of gnome-python do you have installed on your system?  Also,
make sure you have a relatively new gnome-libs (ie. 1.0.5x) installed.  I
didn't have any trouble with Matt's example.

James.

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


On 13 Mar 2000, Hrvoje Niksic wrote:

> Matt Wilson <[EMAIL PROTECTED]> writes:
> 
> > On Mon, Mar 13, 2000 at 09:10:06AM +0100, Hrvoje Niksic wrote:
> > > % python a.py
> > > GnomeUI-Message: The antialiased canvas is buggy.  Please do not use it unless 
>you know what you are doing.
> > 
> > I know what I'm doing. ;)
> > 
> > It's not bad in simple cases.  You have to get very complex before
> > you see major problems, and they're usually minor.
> 
> Hmm.
> 
> > You saw the anti-alised line though, right?
> 
> I didn't.  I even said so, but it got joined with the "To unsubscribe"
> line.
> 
> To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
> 

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



Re: [pygtk] Anti-aliasing ?

2000-03-13 Thread Hrvoje Niksic

Matt Wilson <[EMAIL PROTECTED]> writes:

> On Mon, Mar 13, 2000 at 09:10:06AM +0100, Hrvoje Niksic wrote:
> > % python a.py
> > GnomeUI-Message: The antialiased canvas is buggy.  Please do not use it unless you 
>know what you are doing.
> 
> I know what I'm doing. ;)
> 
> It's not bad in simple cases.  You have to get very complex before
> you see major problems, and they're usually minor.

Hmm.

> You saw the anti-alised line though, right?

I didn't.  I even said so, but it got joined with the "To unsubscribe"
line.

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



Re: [pygtk] Anti-aliasing ?

2000-03-13 Thread Matt Wilson

On Mon, Mar 13, 2000 at 09:10:06AM +0100, Hrvoje Niksic wrote:
> % python a.py
> GnomeUI-Message: The antialiased canvas is buggy.  Please do not use it unless you 
>know what you are doing.

I know what I'm doing. ;)

It's not bad in simple cases.  You have to get very complex before you
see major problems, and they're usually minor.

You saw the anti-alised line though, right?

Matt

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



Re: [pygtk] Anti-aliasing ?

2000-03-13 Thread Hrvoje Niksic

Matt Wilson <[EMAIL PROTECTED]> writes:

> On Sun, Mar 12, 2000 at 11:36:22PM -0500, François Pinard wrote:
> > The code below shows the case of a line needing anti-aliasing.
> > Would someone knowledgeable tell me if/how I can, within `pygtk',
> > produce an anti-aliased line, or else (:-), how I could handle an
> > alpha channel for later display?  And if you see anything else
> > stylistically or logically wrong with this tiny program, also tell
> > me, as I'm still learning how to do my first steps!
> 
> The easiest way to do this by far is to use the canvas.  The
> "aa=TRUE" argument turns on anti-aliasing.  It also does alpha
> chanel for you.  With your program, you would also have to handle
> expose events and repaint the exposed area.  The canvas does all
> this for you.
...

When I run your program, I get:

% python a.py
GnomeUI-Message: The antialiased canvas is buggy.  Please do not use it unless you 
know what you are doing.

A window opens, but no contents in it.
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]