Forum: Ruby-Gnome 2 Non-modal ListView editors don't close - then crash when closed

7e6cdf272a7177072fecd8e019bcf6f7?d=identicon&s=25 Chris Phoenix (chrisphoenix)
on 2014-04-30 09:17
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
0d130f179f85401f248e6ebc2ef8292f?d=identicon&s=25 Eric C. (eric_c)
on 2014-05-03 01:03
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
7e6cdf272a7177072fecd8e019bcf6f7?d=identicon&s=25 Chris Phoenix (chrisphoenix)
on 2014-05-03 03:20
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.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.