# Non-modal ListView editors don't close - then crash when closed

**URL:** <https://www.ruby-forum.com/t/non-modal-listview-editors-dont-close-then-crash-when-closed/240780>\
**Category:** Ruby-Gnome 2\
**Created:** [April 30, 2014, 9:17am UTC](https://www.ruby-forum.com/t/non-modal-listview-editors-dont-close-then-crash-when-closed/240780 "2014-04-30T09:17:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [April 30, 2014, 9:17am UTC](https://www.ruby-forum.com/t/non-modal-listview-editors-dont-close-then-crash-when-closed/240780/1 "2014-04-30T09:17:22Z")

</div>

I’m displaying my own classes in a ListView; the classes have a show()  
method and a Glade window definition, so I can edit the objects by  
double-clicking.

I want these editor windows to be non-modal - I want to be able to open  
several of them at once, and go back to working in the parent window. So  
I set non-modal and delete-with-parent in Glade.

When I close the parent window (the one that contained the ListView) the  
editor windows do not close. But when I then close them, the program  
crashes with a  
C:/Ruby193/lib/ruby/gems/1.9.1/gems/vrlib-1.0.16/lib/treeview/columns/CellRendererObject.rb:39:in  
`signal\_emit\_stop’: destroyed GLib::Object

Is there a way to do this? Or do I have to use only modal editor  
windows?

Thanks,  
Chris

---

<div class="post-metadata">

**Author:** ![mahadewa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@mahadewa](https://www.ruby-forum.com/u/mahadewa)\
**Post date:** [May 3, 2014, 1:03am UTC](https://www.ruby-forum.com/t/non-modal-listview-editors-dont-close-then-crash-when-closed/240780/2 "2014-05-03T01:03:45Z")

</div>

Just liik at the child window example. You don’t need to set anything  
in glade. Its really simple. There are two types of windows in visual  
ruby:

1. No Parent (modal) Modal windows don’t need to have a parent  
identified because you must close the child first (modal)

2. Parent set (non-modal) When you set the parent, visualruby knows  
that if the parent closes it should close the child too.

Here’s the code to open a child window:

def buttonOpenChild\_\_clicked(\*argv)  
MyChildClass.new.show(self) #self = parent  
end

def modalButton\_\_clicked(\*argv)  
MyChildClass.new.show  
end

You pass the parent reference to the show() method to create a non-modal  
window.

E

---

<div class="post-metadata">

**Author:** ![mahadewa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@mahadewa](https://www.ruby-forum.com/u/mahadewa)\
**Post date:** [May 3, 2014, 3:20am UTC](https://www.ruby-forum.com/t/non-modal-listview-editors-dont-close-then-crash-when-closed/240780/3 "2014-05-03T03:20:05Z")

</div>

Huh. That’s how I was doing it.

When I set modal “no” in Glade, and then don’t pass self to show(), it  
works fine.

Anyway, it’s now working fine.
