944,123 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Marked Solved
  • Views: 1899
  • Python RSS
May 20th, 2006
0

wxpython gdk error on fedora 5 (fc5)

Expand Post »
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()
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
NumNut is offline Offline
3 posts
since May 2006
May 21st, 2006
0

Re: wxpython gdk error on fedora 5 (fc5)

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
Reputation Points: 404
Solved Threads: 180
Nearly a Posting Virtuoso
bumsfeld is offline Offline
1,422 posts
since Jul 2005
May 21st, 2006
0

Re: wxpython gdk error on fedora 5 (fc5)

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
NumNut is offline Offline
3 posts
since May 2006
May 21st, 2006
0

Re: wxpython gdk error on fedora 5 (fc5)

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
NumNut is offline Offline
3 posts
since May 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: Loop through a year
Next Thread in Python Forum Timeline: Counted loop - Help please





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC