Re: [pygtk] 2.24.8 issue on win32 with 16bpp display

2011-12-13 Thread Dieter Verfaillie

On Mon, 12 Dec 2011 13:08:43 -0800 (PST), EricHoffman wrote:
I've recently updated my app to use 2.24.8 and receive the following 
failure

on one of my test boxes which is set to 16bpp display:

gdk_win32_pixmap_new: depth = 16 not supported.

Google pointed me to the changeset which seems to have introduced 
this

issue:


This was fixed a couple of days ago in this commit:
http://git.gnome.org/browse/gtk+/commit/?h=gtk-2-24&id=ba8c4bb049b36b3707c2c8f22c5c66b497e2d2cf
and will be included with GTK+ 2.24.9

Another important tidbit of info: make sure your cairo contains
the patches from https://bugs.freedesktop.org/show_bug.cgi?id=42739 and
https://bugs.freedesktop.org/show_bug.cgi?id=42821
The 1.10.2-2 binaries on www.gtk.org/ftp.gnome.org (also included
with the latest GTK+ bundle) and the Open Build Service are known
to be OK.

mvg,
Dieter

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


Re: [pygtk] How to clear/delete all values from the gtk.Liststore

2011-12-13 Thread Yann Leboulanger

Le 13/12/2011 16:14, Arun p das a écrit :

I am new to pygtk. currently i am doing one application using pygtk and glade.
my Question is How to clear/delete all values from the gtk.Liststore.
I am using the liststore as model for combobox.


http://pygtk.org/docs/pygtk/class-gtkliststore.html will help you.

liststore.clear() is the function you're looking for.
--
Yann
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


[pygtk] 2.24.8 issue on win32 with 16bpp display

2011-12-13 Thread EricHoffman

I've recently updated my app to use 2.24.8 and receive the following failure
on one of my test boxes which is set to 16bpp display:

gdk_win32_pixmap_new: depth = 16 not supported.

Google pointed me to the changeset which seems to have introduced this
issue:

commit 2ae574ab6dd1f9810c4667920f9984ed1e95d0f7
Author: Alexander Larsson 
Date:   Wed Nov 9 13:25:02 2011 +0100
win32: Let cairo create DIBs for GdkPixmap

The win32 code for GdkPixmap dib creation workes as such, but
when creating a cairo surface for it with cairo_win32_surface_create
from the HDC it fails for any bitmap format than RGB24, due to
assumptions in cairo.

In order to create a cairo surface for e.g. A1 formats we need
to let cairo create the surface via cairo_win32_surface_create_with_dib.
Additionally, we must then make sure to use this surface in
gdk_drawable_ref_cairo_surface, and to not create a new HDC for
it but reuse the cairo one (as only one HDC can write to a bitmap).

Even with this fixed there are some issues with current cairo, as
cairo A1 format isn't quite the same as win32 monochrome bitmaps.
Fixes for cairo will be submitted.


The actual hunk of new code where I think the error arises is as follows:
@@ -173,6 +165,27 @@ _gdk_pixmap_new (GdkDrawable *drawable,
   GDK_NOTE (PIXMAP, g_print ("gdk_pixmap_new: %dx%dx%d drawable=%p\n",
 width, height, depth, drawable));
 
+  switch (depth)
+{
+case 1:
+  format = CAIRO_FORMAT_A1;
+  break;
+
+case 8:
+  format = CAIRO_FORMAT_A8;
+  break;
+
+case 24:
+case 32:
+  format = CAIRO_FORMAT_RGB24;
+  break;
+
+default:
+  g_warning ("gdk_win32_pixmap_new: depth = %d not supported", depth);
+  return NULL;
+  break;
+}

The fact that it returns NULL in the case that depth == 16 then causes a
cascade of other errors to be output.

Let me know if I can help with any patch testing, or need any other info.

-- 
View this message in context: 
http://old.nabble.com/2.24.8-issue-on-win32-with-16bpp-display-tp32960871p32960871.html
Sent from the Gtk+ - Python mailing list archive at Nabble.com.

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


Re: [pygtk] How to clear/delete all values from the gtk.Liststore

2011-12-13 Thread Pietro Battiston
Il giorno mar, 13/12/2011 alle 20.44 +0530, Arun p das ha scritto:
> I am new to pygtk. currently i am doing one application using pygtk and glade.
> my Question is How to clear/delete all values from the gtk.Liststore.

How about gtk.ListStore.clear() and, more in general, reading the
documentation for gtk.ListStore?

Pietro

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


Re: [pygtk] How to clear/delete all values from the gtk.Liststore

2011-12-13 Thread Zoltán Vörös

Hi,

self.builder.get_object('liststore_some_liststore').clear() should work. 
You can also do something like this:



model = self.builder.get_object('treeview_some_treeview').get_model()
model.clear()

if you just want to clear the list store linked to a treeview or whatever.
I hope this helps,

Zoltán

On 12/13/2011 04:14 PM, Arun p das wrote:

I am new to pygtk. currently i am doing one application using pygtk and glade.
my Question is How to clear/delete all values from the gtk.Liststore.
I am using the liststore as model for combobox.
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


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


[pygtk] How to clear/delete all values from the gtk.Liststore

2011-12-13 Thread Arun p das
I am new to pygtk. currently i am doing one application using pygtk and glade.
my Question is How to clear/delete all values from the gtk.Liststore.
I am using the liststore as model for combobox.
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


[pygtk] clearing combo box value

2011-12-13 Thread Arun p das
>From the text box i am reading key values and appending into store and
later i am setting the combobox model as the store i created. The
problem here is all values are repeating along with the added value (
list of values are duplicating inside the combobox ) what to do with
this? Is there any function to clear the store values ?

a
b
c

after adding value "d" i am getting

a  a
b  b
c  c
d d

 def DescribeKeypair(self):
.
.
 cbox = self.builder.get_object("key_namecombo")
while ihttp://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/