RE: Signals for combobox entry



Here are two examples that will exhibit the behavior you desire:

my $combo = Gtk2::ComboBoxEntry->new;
$combo->signal_connect(changed => \&changed);
$combo->signal_connect('focus-out-event' => \&focus_out);

sub changed
{
        my $combo = shift;
        $combo->{changed} = TRUE;
}

sub focus_out
{
        my $combo = shift;
        # commit to database if $combo->{changed};
        $combo->{changed} = FALSE;
}


my $combo = Gtk2::ComboBoxEntry->new;
$combo->signal_connect('focus-in-event'  => \&focus_in);
$combo->signal_connect('focus-out-event' => \&focus_out);

sub focus_in
{
        my $combo = shift;
        $combo->{check} = $comb->get_active_text;
}

sub focus_out
{
        my $combo = shift;
        # commit to database if $combo->{check} ne $comb->get_active_text;
        $combo->{check} = '';
}



-----Original Message-----
From: gtk-perl-list-bounces gnome org [mailto:gtk-perl-list-bounces gnome org] On Behalf Of Dave Howorth
Sent: Tuesday, October 07, 2008 9:42 AM
To: gtk-perl-list gnome org
Subject: Re: Signals for combobox entry

Mike Martin wrote:
however for the comboboxentry, changed isnt acceptable as it fires on
every change (runs database query so not good performance)

No keypress events seem to be generated for CBE so are there any other
approaches that will fire only when whole field has been updated?

Connect to the changed signal of its Entry child?

Cheers, Dave
_______________________________________________
gtk-perl-list mailing list
gtk-perl-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list



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