Re: loadBindings + closing an abiwidget

From: Daniel Carvalho <idnael_at_gmail.com>
Date: Thu Feb 26 2009 - 19:28:44 CET

daniel@daniubuntu:~/comp/Doques/src$ gdb python
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(gdb) run t_abiclose.py
Starting program: /usr/bin/python t_abiclose.py
[Thread debugging using libthread_db enabled]
[New Thread 0xb7f038c0 (LWP 29518)]
Open /tmp/_teste0hd-I0g.txt
Close...
Open /tmp/_teste1xAZ9XD.txt

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7f038c0 (LWP 29518)]
0xb6cf7a5f in XAP_App::setInputMode (this=0x88b5380, szName=0x8989784
"default",
    bForce=true) at xap_App.cpp:1310
1310 getFrame(i)->getCurrentView()->notifyListeners(AV_CHG_INPUTMODE);
Current language: auto; currently c++
(gdb)

2009/2/26 Dominic Lachowicz <domlachowicz@gmail.com>:
> Can you provide a backtrace? You can run the python EXE inside of GDB,
> and print out the BT when it crashes.
>
> On Thu, Feb 26, 2009 at 1:20 PM, Daniel Carvalho <idnael@gmail.com> wrote:
>> 2008/12/29 Daniel Carvalho <idnael@gmail.com>:
>>>
>>> hello
>>>
>>> I have multiple abiwidgets inside a gtk.Notebook (a container that has
>>> multiple tabs, one for each child).
>>>
>>
>> Hi again
>>
>> This was a problem I mentioned some months ago.
>>
>> When I installed trunk, I found it has changed...
>>
>> Now it crashs if I create a Canvas, close it, and open another one.
>> But only if I had have made a call to
>> editor.invoke_cmd("com.abisource.abiword.loadbindings.fromURI","keybindings.xml",0,0)
>>
>> thats strange...
>>
>> Please see this ready to run example:
>> If you comment the invoke_cmd call, it will work perfectly.
>> I send the keybindings.xml file as attachment in this message. [ I
>> think I took that file from the olpc project or from a sample project
>> bundled with pyabiword]
>>
>>
>>
>> #!/usr/bin/env python
>> # -*- coding: utf-8 -*-
>>
>> import pygtk
>> pygtk.require('2.0')
>> import gtk
>>
>> import abiword
>>
>> import os.path
>> import tempfile
>> import shutil
>>
>> import tempfile
>>
>>
>> class Tabes(gtk.Notebook):
>>
>>   def __init__(self):
>>
>>       gtk.Notebook.__init__(self)
>>       self.popup_enable()
>>
>>       self.set_scrollable(True)
>>       self.set_show_border(False)
>>
>>   def __map_editor_cb(self,widget,event,editor):
>>
>>       editor.invoke_cmd("com.abisource.abiword.loadbindings.fromURI","keybindings.xml",0,0)
>>
>>
>>   n=0
>>   def teste_open_cb(self,widget, data=None):
>>
>>       path=tempfile.mkstemp(".txt","_teste"+str(self.n))[1]
>>       f=open(path,"w")
>>       f.write("ola "+str(self.n)+"\n"+path)
>>       f.close()
>>
>>       print "Open "+path
>>
>>       nome=os.path.basename(path)
>>
>>       editor=abiword.Canvas()
>>       # nota: path tem que ser absoluto...
>>       editor.load_file("file:"+path,path)
>>
>>
>>       editor.set_show_margin(False) # sem efeito...
>>
>>       editor.connect_after("map-event",self.__map_editor_cb,editor)
>>
>>       editor.show()
>>
>>       lab=gtk.Label(nome)
>>
>>       index=self.append_page(editor,lab)
>>       self.set_current_page(index)
>>
>>       self.n = (self.n+1 ) % 30
>>
>>   def teste_close_cb(self,widget, data=None):
>>       if self.get_n_pages()==0:
>>           return
>>
>>       print "Close..."
>>       pnum=self.get_current_page()
>>       editor=self.get_nth_page(pnum)
>>
>>       self.remove_page(pnum)
>>       editor.destroy()
>>
>>
>>
>> if __name__ == "__main__":
>>
>>   window=gtk.Window(gtk.WINDOW_TOPLEVEL)
>>   window.set_default_size(640, 480)
>>
>>   box=gtk.VBox(False,5)
>>   box.show()
>>   window.add(box)
>>
>>   tabes=Tabes()
>>   box.add(tabes)
>>   tabes.show()
>>
>>   # buttons:
>>
>>   b=gtk.Button("open")
>>   b.show()
>>   b.connect("clicked",tabes.teste_open_cb, None)
>>   box.pack_end(b,False,False)
>>
>>   b=gtk.Button("close")
>>   b.show()
>>   b.connect("clicked",tabes.teste_close_cb, None)
>>   box.pack_end(b,False,False)
>>
>>   window.show()
>>
>>   gtk.main()
>>
>
>
>
> --
> Mediocrity knows nothing higher than itself; but talent instantly
> recognizes genius.
>
Received on Thu Feb 26 19:29:42 2009

This archive was generated by hypermail 2.1.8 : Thu Feb 26 2009 - 19:29:42 CET