[pygtk] style question again

2000-03-02 Thread Javi Roman

I have:

...
style = self.window.get_style ().copy ()
style.bg[STATE_NORMAL] = style.black
self.window.set_style (style)
...

This works correctly, but i want a red background color, and i try:

...
style.bg[STATE_NORMAL] = style.red
...

This fail. I think that i don't understand very well. Can anybody help
me?


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



Re: [pygtk] style question again

2000-03-02 Thread James Henstridge

There isn't a style.red attribute.  To create the colour red in the
colormap used by the widget, use one of the following:
  red = widget.get_colormap().alloc('red')
  red = widget.get_colormap().alloc('#ff')
  red = widget.get_colormap().alloc(0x, 0, 0)

All these forms are equivalent (the last is a little bit faster, but the
first allows the system administrator to redefine red to something else in
/usr/lib/X11/rgb.txt :)

James.

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


On Thu, 2 Mar 2000, Javi Roman wrote:

 I have:
 
   ...
   style = self.window.get_style ().copy ()
 style.bg[STATE_NORMAL] = style.black
 self.window.set_style (style)
 ...
 
 This works correctly, but i want a red background color, and i try:
 
   ...
   style.bg[STATE_NORMAL] = style.red
   ...
 
 This fail. I think that i don't understand very well. Can anybody help
 me?
 
 
 Regards.
 To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
 

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



[pygtk] Patch for GtkWidget.set_scroll_adjustment

2000-03-02 Thread John Ehresman


The GtkWidget.set_scroll_adjustment method wasn't returning the result
from the gtk_widget_set_scroll_adjustments extension module function.  The
patch below adds the return to the method; it was made against the pygtk
0.6.4 release.

John

*** /home/jpe/down/pygtk-0.6.4/gtk.py   Wed Feb 16 09:57:02 2000
--- gtk.py  Thu Mar  2 11:27:54 2000
***
*** 430,436 
def set_parent_window(self, parent):
_gtk.gtk_widget_set_parent_window(self._o, parent)
def set_scroll_adjustments(self, hadj, vadj):
!   _gtk.gtk_widget_set_scroll_adjustments(self._o,hadj._o,vadj._o)
def set_sensitive(self, s):
_gtk.gtk_widget_set_sensitive(self._o, s)
def set_state(self, s):
--- 430,437 
def set_parent_window(self, parent):
_gtk.gtk_widget_set_parent_window(self._o, parent)
def set_scroll_adjustments(self, hadj, vadj):
!   return _gtk.gtk_widget_set_scroll_adjustments(self._o, hadj._o,
! vadj._o)
def set_sensitive(self, s):
_gtk.gtk_widget_set_sensitive(self._o, s)
def set_state(self, s):





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



[pygtk] Background color

2000-03-02 Thread Javi Roman

I need a GtkVBox with buttons but i want that this vbox has a pixmap
background. How i can do it?

I need a simple example. Thaks.
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]