Re: Cannot catch signals from buttons of a gnome-dialog



Hi Sylvain,

I am sorry to reply so late but I have been away for a time.

Sylvain Daubert wrote:

Hi,

I'm using Gtk-Perl via Glade, and i created a gnome-dialog with stock buttons. On these buttons, via Glade, 
I put signal handlers. But, when I run my app and click on these buttons, handlers are never called.
Where do I make a mistake ?
This is not your mistake - there are problems constructing Gnome::Dialog
widgets from Glade files. The buttons are automagically constructed by
gnome-libs and so it is not easy to correlate the buttons in the Glade
file and those on the form.

There are warning messages generated in the log 'Project.glade2perl.log'
that tell you about this but it is not the best solution.

I will have a look at this again and see if I can reliably connect the
signal handlers in the ProjectUI.pm file.

In the meantime you can connect your own signals by adding lines like
the following wherever you want to construct the dialog - eg:

  my $dialog = new dialog_appel;
  $dialog->TOPLEVEL->show;
  my @buttons = $dialog->TOPLEVEL->buttons

  $button[0]->signal_connect('clicked', 'first_handler', '', 
    ref $dialog, $dialog->INSTANCE);  

  and put the handlers (eg first_handler etc) in dialog_appel class.

Regards, Dermot





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]