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



Hi,

Without seeing the code it is difficult to tell what might have gone
wrong.  My first guess is that the signals are not connected to the
handlers.  Does your code have lines like:

$gladeobj->signal_autoconnect_from_package('main');

or 

$gladeobj->signal_autoconnect;

or

$gladexml->signal_connect_full (
      'on_app1_destroy',
      sub {
              Gtk->main_quit;
      }
);

There are no such lines in my projectUI.pm file. But, in the glade file, signal handlers are declared :

widget>
  <class>GnomeDialog</class>
  <name>dialog_appel</name>
  <type>GTK_WINDOW_TOPLEVEL</type>
  <position>GTK_WIN_POS_NONE</position>
  <modal>False</modal>
  <allow_shrink>False</allow_shrink>
  <allow_grow>False</allow_grow>
  <auto_shrink>False</auto_shrink>
  <auto_close>False</auto_close>
  <hide_on_close>False</hide_on_close>
   
  <snip...>
        
      <widget>
        <class>GtkButton</class>
        <name>button3</name>
        <can_default>True</can_default>
        <can_focus>True</can_focus>
        <signal>
          <name>clicked</name>
          <handler>on_button3_clicked</handler>
          <last_modification_time>Wed, 28 Aug 2002 08:22:13 GMT</last_modification_time>
        </signal>
        <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
      </widget>

  <snip...>


Here is a piece of code generated by glade (new function to create dialog) :

sub new {
#
# This sub will create the UI window
    my $that  = shift;
    my $class = ref($that) || $that;
    my $self  = {
        $permitted_fields   => \%fields, %fields,
        _permitted_stubs    => \%stubs,  %stubs,
    };
    my ($forms, $widgets, $data, $work);
    my $instance = 1;
    # Get a unique toplevel widget structure
    while (defined $__PACKAGE__::all_forms->{"dialog_appel-$instance"}) {$instance++;}
    #
    # Construct a GnomeDialog 'dialog_appel'
    $widgets->{'dialog_appel'} = new Gnome::Dialog(_(''));
    $widgets->{'dialog_appel'}->close_hides(0 );
    $widgets->{'dialog_appel'}->set_close(0 );
    $widgets->{'dialog_appel'}->position('none' );
    $widgets->{'dialog_appel'}->set_policy(0, 0, 0 );
    $widgets->{'dialog_appel'}->set_modal(0 );
    $widgets->{'dialog_appel'}->realize;
    $forms->{'dialog_appel'}{'tooltips'} = new Gtk::Tooltips;
    $forms->{'dialog_appel'}{'accelgroup'} = new Gtk::AccelGroup;
    $forms->{'dialog_appel'}{'accelgroup'}->attach($widgets->{'dialog_appel'} );
    $forms->{'dialog_appel'}{'dialog_appel'} = $widgets->{'dialog_appel'};
        #
        # Construct a GtkVBox 'dialog-vbox2'
        $widgets->{'dialog-vbox2'} = $forms->{'dialog_appel'}{'dialog_appel'}->vbox;
        $widgets->{'dialog-vbox2'}->show;
        $forms->{'dialog_appel'}{'dialog-vbox2'} = $widgets->{'dialog-vbox2'};
            #
            # Construct a GtkHButtonBox 'dialog-action_area2'
            $forms->{'dialog_appel'}{'dialog_appel'}->append_button('Button_Ok');
            $forms->{'dialog_appel'}{'dialog_appel'}->append_button('Button_Cancel');
            $widgets->{'dialog-action_area2'} = $forms->{'dialog_appel'}{'dialog_appel'}->action_area;
            $widgets->{'dialog-action_area2'}->show;

snip...

In the code, buttons are appended to dialog but no signals are connected.

So, i've a signal handler in my glade file. And when i generate my perl code, no signal is conected on 
button. I think there's a bug or there's something i don't understand (sure).


Sylvain



______________________________________________________________________________
Pour mieux recevoir vos emails, utilisez un PC plus performant !
Découvrez la nouvelle gamme DELL en exclusivité sur i (france)
http://www.ifrance.com/_reloc/signedell




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