0

I have a GTK python program I am developing. I need to change the look of the window based on the type of activity the user is doing. I'm using a Gtk.Grid() object that I was planning on just calling widget.hide() on the things I need to appear and widget2.show() on the ones I need to show for the change. I've never done anything like this, and was experimenting around.

An example of the GUI interface is this

______________________
| Label1   |  Button |
| Label2   |         |
| Label3   |         |
______________________

When I click on button, calls an iterable object I have created that calls Label1.hide(), etc. The interface is an horizontal Gtk.Box() with a grid for the labels on the left and then the button object on the right.

When I get to the last Label3 and then Click the "Button" button, the program unexpectedly exits with this as output:

Floating point exception

There is no traceback. I think it is coming from GTK itself. I am using GTK3 which uses gobject introspection.

What might be causing the exception and is there a way around?

I believe I can get around this by doing a Label4.show() before getting ride of the last (Label3) object. I'm just curious what is the reason in the first place.

I have done a lot of Googling around, but nothing seems to address this issue.

Thanks,

Narnie

narnie
  • 1,742
  • 1
  • 18
  • 34
  • Have you tried getting a traceback from gdb yet? – Ignacio Vazquez-Abrams Mar 24 '12 at 04:44
  • I checked in to gdb. Unfortunately, my Linux installation's (Debian testing) gdb doesn't support python (no -P or --python arg) and I have no gdb module for python. What am I missing? – narnie Mar 24 '12 at 17:24
  • OK, I installed python2.7-dbg and was going to attach it to gdb with the process id, but python2.7-dbg fails once the Gtk is imported from gi.repository due to an undefined symbol. – narnie Mar 24 '12 at 17:46
  • Stupid me forgot gi wasn't python core. I installed the python-gi-dbg package and was able to get it to run. From gdb, I get "Program received signal SIGFPE, Arithmetic exception. 0x00007ffff33a6b86 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0" Since it is in the C libgtk module, sounds like it may be a bug. Should I just do a bug report and call it quits and do my workaround? – narnie Mar 24 '12 at 18:33
  • I added libgtk-3-0-dbg and got "Program received signal SIGFPE, Arithmetic exception. 0x00007ffff33a6b86 in gtk_grid_request_allocate (request=0x7fffffffc0c0, orientation=, total_size=0) at /tmp/buildd/gtk+3.0-3.2.3/./gtk/gtkgrid.c:992 992 /tmp/buildd/gtk+3.0-3.2.3/./gtk/gtkgrid.c: No such file or directory." – narnie Mar 24 '12 at 18:41
  • 1
    After posting a bug (after trying to search for it in the first place), it turns out this is a known bug and has already been patched for libgtk's > 3.0. – narnie Mar 24 '12 at 21:26

0 Answers0