[pygtk] Style

2000-08-24 Thread Javi Roman

After of fighting much I have managed to control the progress bar 
(thanks to the people that helped me). Now I have the following 
problem: I want to change the color of the bar. I have tried all 
type of combinations of styles and I have not obtained it.
Since I can do it? 

mycolor = 'blue' # for instance

self.progress = GtkProgressBar ()
style = self.progress.get_style ().copy ()
color = self.progress.get_colormap().alloc(mycolor)
style.base[STATE_ACTIVE] = color
self.progress.set_style (style) 


So what´s the suitable combination to change the color of the bar?

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] Mozilla embedding widget questions

2000-08-24 Thread Jens P. Elsner

Hi,

 Again a post which didn't made it to the list :-(
Sorry, but your post did not go to the list (iirc), so I replied to you
instead of the list.

   Visit http://www.python.org/doc/current/ext/refcounts.html
  I've read that already, but I didnt get the concept. 
  When do I have to use it?
 
 Every time you use a "copy" of a Python object. Incrementing the 
 reference count while using it will make sure that it isn't deleted
 while you use it. Basically what happens is this (pseudo code):
[...]

Thanks for your explanation!

Jens

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] Style

2000-08-24 Thread acano

On Thu, 24 Aug 2000 11:45:16 +0200, Javi Roman [EMAIL PROTECTED] wrote:
 After of fighting much I have managed to control the progress bar 
 (thanks to the people that helped me). Now I have the following 
 problem: I want to change the color of the bar. I have tried all 
 type of combinations of styles and I have not obtained it.
 Since I can do it? 
 
 mycolor = 'blue' # for instance
 
   self.progress = GtkProgressBar ()
   style = self.progress.get_style ().copy ()
   color = self.progress.get_colormap().alloc(mycolor)
   style.base[STATE_ACTIVE] = color
   self.progress.set_style (style) 
 
 
 So what´s the suitable combination to change the color of the bar?
 
 ___
 pygtk mailing list   [EMAIL PROTECTED]
 http://www.daa.com.au/mailman/listinfo/pygtk
 

When in doubt:

style = self.progress.get_style().copy ()
color = self.progress.get_colormap().alloc (mycolor)
for i in range (5):
style.bg[i] = mycolor
style.fg[i] = mycolor
style.base[i] = mycolor
self.progress.set_style (style)


After a process of elimination it turns out that
style.bg[STATE_PRELIGHT] = mycolor 
seemed to change it... go figure.


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk