wxpython gdk error on fedora 5 (fc5)

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: May 2006
Posts: 3
Reputation: NumNut is an unknown quantity at this point 
Solved Threads: 0
NumNut NumNut is offline Offline
Newbie Poster

wxpython gdk error on fedora 5 (fc5)

 
0
  #1
May 20th, 2006
Hello,

I am using fedora 5 and installed wxpython in an effort to program in python/wxpython (installed wxPython-2.6.3.2-1.fc5.i386.rpm, wxGTK-2.6.3-2.6.3.2.1.fc5.i386.rpm and wxGTK-gl-2.6.3-2.6.3.2.1.fc5.i386.rpm).

When I run my test script to create a frame, a notebook and an image on one of the pages of the notebook, I get a GDK error when the application closes:

(python:20707): Gdk-CRITICAL **: gdk_drawable_get_depth: assertion `GDK_IS_DRAWABLE (drawable)' failed

(python:20707): Gtk-CRITICAL **: gtk_pixmap_set: assertion `gdk_colormap_get_visual (gtk_widget_get_colormap (GTK_WIDGET (pixmap)))->depth == gdk_drawable_get_depth (GDK_DRAWABLE (val))' failed


The same error occurs after closing the wxpython demo application (demo.py) available from the wxpython web site if you're viewing their notebook code example on which an image (a yellow happy face) appears on a notebook page.

If I avoid placing an image on the page of the notebook by negating the line 'self.mainnotebook.SetPageImage(self.mainnotebook.GetPageCount()-1, self.idx1)', the error disappears.

Can anyone help me solve this annoying problem, as I want the pages of my notebook to have images. The png image I am showing (test.png in my test script) is a stock image (24x24) I obtained from my fc5 installation. Any assistance will be appreciated.

My test.py script follows:


#!/usr/bin/python

import wx
import os

daappfolderpath = os.path.dirname(__file__)

class damainframe(wx.Frame):

def __init__(self, parent, ID, title):

wx.Frame.__init__(self, parent, -1, title)
self.Bind(wx.EVT_CLOSE, self.closeapp)

self.mainbox = wx.BoxSizer(wx.VERTICAL)

# make notebook
self.mainnotebook = wx.Notebook(self,-1)

self.frontispiecepanel = wx.Panel(self.mainnotebook, -1)
self.mainnotebook.AddPage(self.frontispiecepanel, " page 1 ", False)

self.pdfpanel = wx.Panel(self.mainnotebook, -1)
self.mainnotebook.AddPage(self.pdfpanel, " page 2 ", False)

self.sendpanel = wx.Panel(self.mainnotebook, -1)
self.mainnotebook.AddPage(self.sendpanel, " page 3 ", False)

# make image list for mainnotebook
self.il = wx.ImageList(24, 24)
self.idx1 = self.il.Add(wx.Bitmap(os.path.join(daappfolderpath, "test.png"),wx.BITMAP_TYPE_PNG))
self.mainnotebook.AssignImageList(self.il)
self.mainnotebook.SetPageImage(self.mainnotebook.GetPageCount()-1, self.idx1)

self.mainbox.Add(self.mainnotebook, 1, wx.EXPAND)

self.SetAutoLayout(True)
self.SetSizer(self.mainbox)
self.Layout()

self.CreateStatusBar()

def closeapp(self, evt):
self.Destroy()


class daapp(wx.App):
def OnInit(self):
frame = damainframe(None, -1, "")
self.SetTopWindow(frame)
frame.Show(True)
return True

app = daapp(0)
app.MainLoop()
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,221
Reputation: bumsfeld will become famous soon enough bumsfeld will become famous soon enough 
Solved Threads: 138
bumsfeld's Avatar
bumsfeld bumsfeld is offline Offline
Nearly a Posting Virtuoso

Re: wxpython gdk error on fedora 5 (fc5)

 
0
  #2
May 21st, 2006
I don't have linux OS on my machine, but fail to understand why wxPython should bring up a gtk error?

Also, is gdk and gtk a mix up?

Please use code tags around your Python code to show proper indentations, take a look here:
http://www.daniweb.com/techtalkforum...ment114-3.html
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3
Reputation: NumNut is an unknown quantity at this point 
Solved Threads: 0
NumNut NumNut is offline Offline
Newbie Poster

Re: wxpython gdk error on fedora 5 (fc5)

 
0
  #3
May 21st, 2006
Thanks for the reply.

Unfortunately I can't comment on the nature of the error produced after my simple application closes.

I am just puzzled and somewhat disheartened, as it was my intention to write a script that would run flawlessly on a linux and win32 wxpython framework.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3
Reputation: NumNut is an unknown quantity at this point 
Solved Threads: 0
NumNut NumNut is offline Offline
Newbie Poster

Re: wxpython gdk error on fedora 5 (fc5)

 
0
  #4
May 21st, 2006
I have just received a potential solution from leio at sourceforge, and hope it helps others:


Date: 2006-05-21 15:07
Sender: leio

This is a temporary regression in gtk+.
gtk+-2.8.14, 2.8.15 and 2.8.16 are affected.
2.8.17 has it fixed. Try to upgrade or just ignore it until
your distro picks that version (or later) up, if it hasn't
already.

http://bugzilla.gnome.org/show_bug.cgi?id=336254
is the link for the upstream bug.


Thanks to all.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Python
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC