Re: [pygtk] Bold-Face line in a TreeView with glib2.10

2006-05-27 Thread Brian
On Sat, 2006-27-05 at 18:02 +0200, Nemesis wrote:
> On Sat, 27 May 2006 09:01:04 -0700
> Brian <[EMAIL PROTECTED]> wrote:
> 
> [problems with weight-set]
> 
> > It's working for my app just fine.  Currently at glib-2.10.2
> [...]
> 
> > def cell_data_func(self, column, renderer, model, iter, data):
> > """function to render the package name according
> >to whether it is in the world file or not"""
> > #full_name = model.get_value(iter, 0)
> > color = model.get_value(iter, 5)
> > if model.get_value(iter, 4):
> > renderer.set_property("weight", pango.WEIGHT_BOLD)
> > else:
> > renderer.set_property("weight", pango.WEIGHT_NORMAL)
> 
> But you aren't using 'weight-set', you are setting the weight property
> each time to WEIGHT_BOLD or WEIGHT_NORMAL.
> 

Sorry, I wasn't fully awake yet this morning :)  I just grabbed the
chunk of code we have been using.
-- 
Brian <[EMAIL PROTECTED]>

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


[pygtk] wnck.Window.get_geometry missing?

2006-05-27 Thread Magnus Therning
I can't figure out why wnck.Window.get_geometry isn't in the python
bindings.

wnck.defs contains the following

 (define-method get_geometry
   (of-object "WnckWindow")
   (c-name "wnck_window_get_geometry")
   (return-type "none")
   (parameters
 '("int*" "xp")
 '("int*" "yp")
 '("int*" "widthp")
 '("int*" "heightp")
   )
 )

But that doesn't seem to result in the function turning up :-(

I've only tested this on Debian Sid but I can't see any reason for it to
be distro specific. The following would check if it's there:

 import wnck, gtk
 s = wnck.screen_get_default()
 while gtk.events_pending(): gtk.main_iteration()
 w = s.get_active_window()
 print [f for f in dir(w) if f == 'get_geometry']

On my system that results in the printing of an empty list.

Any pointers on how to fix this (I've not managed to find any docs on
pygtk-codegen-2.0 at all) would be much appreciated.

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

If you can explain how you do something, then you're very very bad at
it.
 -- John Hopfield


pgpFHhL3Whqcn.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Bold-Face line in a TreeView with glib2.10

2006-05-27 Thread Nemesis
On Sat, 27 May 2006 09:01:04 -0700
Brian <[EMAIL PROTECTED]> wrote:

[problems with weight-set]

> It's working for my app just fine.  Currently at glib-2.10.2
[...]

> def cell_data_func(self, column, renderer, model, iter, data):
> """function to render the package name according
>to whether it is in the world file or not"""
> #full_name = model.get_value(iter, 0)
> color = model.get_value(iter, 5)
> if model.get_value(iter, 4):
> renderer.set_property("weight", pango.WEIGHT_BOLD)
> else:
> renderer.set_property("weight", pango.WEIGHT_NORMAL)

But you aren't using 'weight-set', you are setting the weight property
each time to WEIGHT_BOLD or WEIGHT_NORMAL.

-- 
 
 |\ |   |HomePage   : http://nem01.altervista.org
 | \|emesis |XPN (my nr): http://xpn.altervista.org
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Bold-Face line in a TreeView with glib2.10

2006-05-27 Thread Brian
On Sat, 2006-27-05 at 15:26 +0200, Nemesis wrote:
> Hi all,
> I'm experimenting a strange behaviour with newer gtk release (the ones
> with glib >2.10).
> I need to set some lines in a treeview in bold-face and some not. So I
> set the textrenderer property "weight" to pango.FONT_WEIGHT and the I
> use row by row the property "weight-set" to select wich row must be
> in bold face.
> This approach is not working with newer gtk releases, the bold face is
> not set, if there is at least one row with the property "weight-set"
> set to False.
> 
> I read that Sylpheed-Claws had the same problem and they fixed it by
> setting row by row the weight property. I could fix my application in
> the same way but I'd like to know if this is a GTK bug or I'm using in
> the wrong way the "weight" and "weight-set" properties.
> What do you think?
> 

It's working for my app just fine.  Currently at glib-2.10.2

some snipits:


# add the text renderer
text = gtk.CellRendererText()
self._column.pack_start(text, expand = True)
self._column.add_attribute(text, "text", 0)
self._column.set_cell_data_func(text, self.cell_data_func, None)


def cell_data_func(self, column, renderer, model, iter, data):
"""function to render the package name according
   to whether it is in the world file or not"""
#full_name = model.get_value(iter, 0)
color = model.get_value(iter, 5)
if model.get_value(iter, 4):
renderer.set_property("weight", pango.WEIGHT_BOLD)
else:
renderer.set_property("weight", pango.WEIGHT_NORMAL)
if color:
#if color == 'blue':
renderer.set_property("foreground", color)
#else:
#renderer.set_property("background", color)
else:
renderer.set_property("foreground-set", False)
#renderer.set_property("background-set", False)
#renderer.set_property("text", full_name)


-- 
Brian <[EMAIL PROTECTED]>

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


[pygtk] Bold-Face line in a TreeView with glib2.10

2006-05-27 Thread Nemesis
Hi all,
I'm experimenting a strange behaviour with newer gtk release (the ones
with glib >2.10).
I need to set some lines in a treeview in bold-face and some not. So I
set the textrenderer property "weight" to pango.FONT_WEIGHT and the I
use row by row the property "weight-set" to select wich row must be
in bold face.
This approach is not working with newer gtk releases, the bold face is
not set, if there is at least one row with the property "weight-set"
set to False.

I read that Sylpheed-Claws had the same problem and they fixed it by
setting row by row the weight property. I could fix my application in
the same way but I'd like to know if this is a GTK bug or I'm using in
the wrong way the "weight" and "weight-set" properties.
What do you think?

-- 
 
 |\ |   |HomePage   : http://nem01.altervista.org
 | \|emesis |XPN (my nr): http://xpn.altervista.org
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/