I am having two problems with a ColorSelection widget, maybe 
folks here can help.

  The first question is simple -- using Python 2.1 and pygtk-0.6.8,
if I try to create a GdkColor from integers, I get an error if the  
integers are larger than 32767, which is the maximum for a two-byte
integer.  E.g., in interactive mode:

>$prompt: python
>Python 2.1 (#11, Apr 30 2001, 18:36:08) [C] on irix646-n32
>Type "copyright", "credits" or "license" for more information.
>>>> import gtk
>>>> gtk.GdkColor(0,0,0)
><GdkColor (0, 0, 0)>
>>>> gtk.GdkColor(65535,0,0)
>Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
>  File "/usr/site/stow/pygtk-0.6.8/lib/python2.1/site-packages/gtk.py", line 35, in 
>GdkColor
>    return _gtk.gdk_color_new(red, green, blue, pixel)
>OverflowError: signed short integer is greater than maximum

  The GTK+ spec calls for color arguments in the range 
(0,65535), and the call produces the correct, very dark colors
for values in (0,32767), but higher-value colors are simply 
unavailable.  The above example is on IRIX, but I get the same 
behavior on Linux/Intel.  Is this just a version mismatch 
problem, or am I doing something else wrong?


  The second question is harder to describe:  I am putting
up a GtkColorSelection widget inside a GtkDialogBox, but with 
a minor difference -- I want my GtkColorSelection widget to be
persistent between dialog box invocations, so the steps are
these:
  1) Create GtkColorSelection widget.
  2) Create GtkDialogBox, add buttons and colorselection widget.
  3) Catch signals from buttons, assign colors, etc.
  4) Remove GtkColorSelection widget from GtkDialogBox.vbox
  5) Destroy GtkDialogBox
  6) Do other stuff until next request for color selection...
  7) Create new GtkDialogBox, add buttons, and add the pre-existing
      GtkColorSelection widget
  
 ... and continue, repeating steps 3-7 as required.  The problem
is the second and subsequent invocations (i.e. all occurrences in
step 7 above) result in this warning:

> Gtk-WARNING **: gtk_signal_disconnect_by_data(): could not find
>  handler containing data (0x1012C2A8)

  Specifically, it happens within the show_all() call to the 
enclosing GtkDialogBox object.  I personally am not connecting any 
of the GtkColorSelector's signals, I get the color selection by
interrogating the GtkColorSelector in the button callback of 
the dialog box.  I use "remove_child" and "add" to remove and 
assign the widget, and am careful to hide() it before removing,
is there another step I'm missing?  Or is it just wrong somehow
to re-parent and re-show a persistent widget like this? 

  Thanks in advance for any clues.

                                -- Andrew Reid
                                   [EMAIL PROTECTED]

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

Reply via email to