Re: Two toplevels in a glade file causes spurious warnings
- From: Gerald Britton <gerald britton gmail com>
- To: Tadej Borovšak <tadeboro gmail com>
- Cc: gtk-list gnome org
- Subject: Re: Two toplevels in a glade file causes spurious warnings
- Date: Mon, 15 Feb 2010 10:19:44 -0500
On Mon, Feb 15, 2010 at 10:11 AM, Tadej Borovšak <tadeboro gmail com> wrote:
> hi.
>
> 2010/2/15 Gerald Britton <gerald britton gmail com>:
>> In gtk 2.18.3-1ubuntu2.2, I have a problem using gtk.builder on glade
>> files with multiple top levels. What happens is, when I call
>> connect_signals on the first top-level, I get warnings that the signal
>> handlers from the subsequent toplevels are "missing." Actually they
>> are not missing, they just aren't used by the current top level.
>
> gtk_builder_connect_signals() will try to connect all signals on your
> built UI that you marked as "connectable". You cannot instruct it to
> only connect signals from one toplevel window. How are you calling
> gtk_builder_connect_signals() that makes you think it will only
> connect signals from one toplevel?
I call it like this:
self.xml.connect_signals({
"on_add_clicked" : self.on_add_clicked,
"on_remove_clicked" : self.on_remove_clicked,
"on_up_clicked" : self.on_up_clicked,
"on_down_clicked" : self.on_down_clicked,
"on_setup_clicked" : self.on_setup_clicked,
"on_clear_clicked" : self.on_clear_clicked,
"on_save_clicked" : self.on_save_clicked,
"on_open_clicked" : self.on_open_clicked,
"on_edit_clicked" : self.on_edit_clicked,
"on_book_ok_clicked" : self.on_book_ok_clicked,
"destroy_passed_object" : self.close,
}
Since there is a second top-level in the glade file, I now have to add
these dummy entries to the first call:
# Insert dummy handlers for second top level in the glade file
"on_booklist_ok_clicked" : lambda _:None,
"on_booklist_delete_clicked": lambda _:None,
"on_booklist_cancel_clicked": lambda _:None,
"on_booklist_ok_clicked" : lambda _:None,
"on_booklist_ok_clicked" : lambda _:None,
Note 1: The dummy handlers get replaced with real handlers when I
activate the second toplevel
Note 2: This seems to have started when I converted old glade files to
use builder.
>
> Tadej
>
>
> --
> Tadej Borovšak
> tadeboro.blogspot.com
> tadeboro gmail com
> tadej borovsak gmail com
>
--
Gerald Britton
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]