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

2006-05-28 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] gtk.button stock images, color change possible?

2006-05-28 Thread Brian
In our app, I have put 3 buttons on the bottom of the window beside the
status bar.  I have made bare buttons and use stock images for two.  One
is a pause image, another is a play image and the third is a custom
clock image.  (specialized terminal app,  command queue features {pause,
run, timer})

Is it possible to change the foreground color of the image depending on
the state?  I have tried using the gtk.Widget.modify_fg(), but it does
not seem to work.  The reason I am trying to change it is because it is
difficult to see whether it is active or not since they are small
buttons.  I realize some of this can be changed by changing my desktop
theme.  I would like to stay with stock images if possible  it suits
the purpose.  Do I have to use custom images for this to work?

snipit:

self.pause_btn.modify_fg(gtk.STATE_INSENSITIVE, 
gtk.gdk.color_parse(#962A1C)) # dark red
self.pause_btn.modify_fg(gtk.STATE_NORMAL, 
gtk.gdk.color_parse(#DA311B))  # med red
self.pause_btn.modify_fg(gtk.STATE_PRELIGHT, 
gtk.gdk.color_parse(#F65540))# light red
self.play_btn.modify_fg(gtk.STATE_INSENSITIVE, 
gtk.gdk.color_parse(#3C6E38))  # dark green
self.play_btn.modify_fg(gtk.STATE_NORMAL, 
gtk.gdk.color_parse(#4EBA44))   # med green
self.play_btn.modify_fg(gtk.STATE_PRELIGHT, 
gtk.gdk.color_parse(#58F64A)) # light green

I just realized something that may be affecting my results.  I have an
instance of the app running some package upgrades from before this
change.  Would that cause python to not create new .pyc files for the
modified files since there is another instance loaded and running?

I'm tired, and heading off to bed.  In the morning ill have an updated
system with gtk+-2.8.18 to test out.
-- 
Brian Dolbec [EMAIL PROTECTED]
-- 
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/


Re: [pygtk] wnck.Window.get_geometry missing?

2006-05-28 Thread Gustavo J. A. M. Carneiro
Sáb, 2006-05-27 às 21:56 +0100, Magnus Therning escreveu:
 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.

  You can start by opening a bug report on gnome bugzilla, product
gnome-python-desktop.  Thanks.

 
 /M
 
 ___
 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/
-- 
Gustavo J. A. M. Carneiro
[EMAIL PROTECTED] [EMAIL PROTECTED]
The universe is always one step beyond logic

___
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] Question about building PyGTK 2.8.6 on Linux

2006-05-28 Thread Tom Williams
Hi!  I'm trying to build PyGTK 2.8.6 on Linux (Slackware 8-based system 
w/ custom mods) and even though it builds, I don't think it's building 
correctly. 


During the build, I get messages like this:

-START---

make[2]: Leaving directory `/home/tom/build/pygtk-2.8.6/gobject'
Making all in .
make[2]: Entering directory `/home/tom/build/pygtk-2.8.6'
if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. 
-I/usr/include/python2.4 -pthread -I/opt/gnome/include/glib-2.0 
-I/opt/gnome/lib/glib-2.0/include   -I./gobject
-I/usr/include/atk-1.0 -I/opt/gnome/include/glib-2.0 
-I/opt/gnome/lib/glib-2.0/include   -g -O2 -Wall -std=c9x 
-fno-strict-aliasing -MT atk_la-atkmodule.lo -MD -MP -MF 
.deps/atk_la-atkmodule.Tpo -c -o atk_la-atkmodule.lo `test -f 
'atkmodule.c' || echo './'`atkmodule.c; \
then mv -f .deps/atk_la-atkmodule.Tpo .deps/atk_la-atkmodule.Plo; 
else rm -f .deps/atk_la-atkmodule.Tpo; exit 1; fi

mkdir .libs
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/include/python2.4 -pthread 
-I/opt/gnome/include/glib-2.0 -I/opt/gnome/lib/glib-2.0/include 
-I./gobject -I/usr/include/atk-1.0 -I/opt/gnome/include/glib-2.0 
-I/opt/gnome/lib/glib-2.0/include -g -O2 -Wall -std=c9x 
-fno-strict-aliasing -MT atk_la-atkmodule.lo -MD -MP -MF 
.deps/atk_la-atkmodule.Tpo -c atkmodule.c  -fPIC -DPIC -o 
.libs/atk_la-atkmodule.o

(cd .\
 /usr/bin/python codegen/codegen.py \
   --register pango-types.defs \
   --register atk-types.defs \
   --override atk.override \
   --prefix pyatk atk.defs)  gen-atk.c \
 cp gen-atk.c atk.c \
 rm -f gen-atk.c
Could not write method AtkObject.connect_property_change_handler: No 
ArgType for 'AtkPropertyChangeHandler*'
Could not write method AtkObject.notify_state_change: No ArgType for 
'AtkState'

Warning: generating old-style constructor for atk_no_op_object_new
Could not write method AtkRelation.get_target: No ArgType for 'GPtrArray*'
Could not write method AtkStateSet.add_states: No ArgType for 
'AtkStateType*'
Could not write method AtkStateSet.contains_states: No ArgType for 
'AtkStateType*'
Could not write function add_focus_tracker: No ArgType for 
'AtkEventListener'
Could not write function focus_tracker_init: No ArgType for 
'AtkEventListenerInit'
Could not write function add_global_event_listener: No ArgType for 
'GSignalEmissionHook'
Could not write function add_key_event_listener: No ArgType for 
'AtkKeySnoopFunc'

Warning: Constructor for AtkNoOpObject needs to be updated to new API
See http://live.gnome.org/PyGTK_2fWhatsNew28#update-constructors
Warning: Constructor for AtkRelation needs to be updated to new API
See http://live.gnome.org/PyGTK_2fWhatsNew28#update-constructors
***INFO*** The coverage of global functions is 77.78% (14/18)
***INFO*** The coverage of methods is 89.58% (43/48)
***INFO*** There are no declared virtual proxies.
***INFO*** There are no declared virtual accessors.
***INFO*** There are no declared interface proxies.
if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. 
-I/usr/include/python2.4 -pthread -I/opt/gnome/include/glib-2.0 
-I/opt/gnome/lib/glib-2.0/include   -I./gobject
-I/usr/include/atk-1.0 -I/opt/gnome/include/glib-2.0 
-I/opt/gnome/lib/glib-2.0/include   -g -O2 -Wall -std=c9x 
-fno-strict-aliasing -MT atk_la-atk.lo -MD -MP -MF 
.deps/atk_la-atk.Tpo -c -o atk_la-atk.lo `test -f 'atk.c' || echo 
'./'`atk.c; \
then mv -f .deps/atk_la-atk.Tpo .deps/atk_la-atk.Plo; else rm -f 
.deps/atk_la-atk.Tpo; exit 1; fi

make[2]: *** [atk_la-atk.lo] Interrupt
make[1]: *** [all-recursive] Interrupt
make: *** [all] Interrupt


real4m7.936s
user0m57.852s
sys 0m6.644s
[EMAIL PROTECTED]:~/build/pygtk-2.8.6$

--END--

My environment:

Linux 2.6.16.16.kernel
glibc 2.4
gcc 4.1.1
glib 2.8.6
gtk+ 2.8.18
atk 1.10.3
pango 1.10.4
cairo 1.0.4
python 2.4.3


I tried looking at the URLs referenced above 
(http://live.gnome.org/PyGTK_2fWhatsNew28#update-constructors), but that 
section (update-constructors) doesn't exist in the referenced page 
(looks like a Wiki page).   The messages like that don't prevent the 
build from stopping (I terminated the above example) and when I run 
make check, I get this:


START

Making check in examples
make[1]: Entering directory `/home/tom/build/pygtk-2.8.6/examples'
make[1]: Nothing to be done for `check'.
make[1]: Leaving directory `/home/tom/build/pygtk-2.8.6/examples'
Making check in tests
make[1]: Entering directory `/home/tom/build/pygtk-2.8.6/tests'
make  check-local
make[2]: Entering directory `/home/tom/build/pygtk-2.8.6/tests'
WARNING: gtk could not be imported
WARNING: gtk.gdk could not be imported
WARNING: gtk.glade could not be imported
Traceback (most recent call last):
 File ./runtests.py, line 41, in ?
   suite.addTest(loader.loadTestsFromName(name))
 File /usr/lib/python2.4/unittest.py, line 524, in loadTestsFromName
   module = __import__('.'.join(parts_copy))
 File ../tests/test_enum.py, 

Re: [pygtk] wnck.Window.get_geometry missing?

2006-05-28 Thread Magnus Therning
On Sun, May 28, 2006 at 12:31:14PM +0100, Gustavo J. A. M. Carneiro wrote:
Sáb, 2006-05-27 às 21:56 +0100, Magnus Therning escreveu:
 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.

  You can start by opening a bug report on gnome bugzilla, product
gnome-python-desktop.  Thanks.

Not really the hands on answer I was hoping for ;-) I was hoping to get
some pointers so I can file the bug report with a patch... I'll just go
ahead and report it and then look into making a patch.

/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.

Finagle's Fourth Law:
Once a job is fouled up, anything done to improve it only makes it
worse.


pgp5v9s0RRned.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] wnck.Window.get_geometry missing?

2006-05-28 Thread Gustavo J. A. M. Carneiro
Dom, 2006-05-28 às 21:01 +0100, Magnus Therning escreveu:
 On Sun, May 28, 2006 at 12:31:14PM +0100, Gustavo J. A. M. Carneiro wrote:
 Sáb, 2006-05-27 às 21:56 +0100, Magnus Therning escreveu:
  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.
 
   You can start by opening a bug report on gnome bugzilla, product
 gnome-python-desktop.  Thanks.
 
 Not really the hands on answer I was hoping for ;-) I was hoping to get
 some pointers so I can file the bug report with a patch... I'll just go
 ahead and report it and then look into making a patch.

  Ok, ok...

  Here's how I'd solve it:

1. comment out the int* parameters in the defs;
2. compile; it's going to fail, of course;
3. go to the generated C file, look for the wrapper, copy it
4. go to the .override file, add something like
%% override wnck_window_get_geometry noargs
paste the wrapper here
5. Edit the wrapper
  a) declare a few int variables, pass the missing arguments by taking
a reference to the variables, like x, y, width, height
  b) replace the Py_None return block with
return Py_BuildValue(, x, y, width, height);
6. Uncomment back the parameters in the .defs
7. Compile, test, submit the patch

  Good luck :-)

-- 
Gustavo J. A. M. Carneiro
[EMAIL PROTECTED] [EMAIL PROTECTED]
The universe is always one step beyond logic

___
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/