| | |
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:
Solved Threads: 0
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()
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()
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
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
•
•
Join Date: May 2006
Posts: 3
Reputation:
Solved Threads: 0
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.
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.
![]() |
Similar Threads
- DNS Problem - rndc: connect failed: connection refused (*nix Software)
- ORA-12157 error when installing Oracle 10g on Fedora 5 (Oracle)
- popup menu does not appear if wx.FileDialog is activated beforehand (Python)
- wxPython Error while running. (Python)
- Flash Plugin For Mozilla (*nix Software)
- Error message when booting or installing XP (Windows NT / 2000 / XP)
Other Threads in the Python Forum
- Previous Thread: Loop through a year
- Next Thread: Counted loop - Help please
| Thread Tools | Search this Thread |
Tag cloud for Python
ansi assignment avogadro backend beginner binary bluetooth character cmd code customdialog data decimals dictionary drive dynamic error examples excel exe file float format ftp function gnu graphics gui heads homework http ideas import input java leftmouse line linux list lists logging loop module mouse newb number numbers output parsing path pointer port prime program programming progressbar projects push py2exe pygame pyqt python random recursion recursive refresh schedule screensaverloopinactive script scrolledtext sqlite ssh statistics stdout string strings sudokusolver sum table terminal text thread threading time tkinter tlapse tricks tuple tutorial ubuntu unicode update urllib urllib2 variable wikipedia windows write wxpython xlib






