Re: GTKCombo: autocomplete?
- From: Daniel Kasak <dkasak nusconsulting com au>
- To: Gtk Perl List <gtk-perl-list gnome org>
- Subject: Re: GTKCombo: autocomplete?
- Date: Fri, 21 May 2004 14:46:37 +1000
muppet wrote:
if you built your gtk2-perl against gtk+ 2.4, there should be a man
page for Gtk2::EntryCompletion listing the methods you can call. the
gtk-demo program (Gtk2/gtk-demo) contains an example of using the
entry completion.
I've had a look at the demo, and adapted it thus:
$liststore = Gtk2::ListStore->new (Glib::String::);
while (my $row = $ms_sth->fetchrow_hashref) {
push @{ $clientlist }, $row->{CompanyName};
$liststore->set ($liststore->append, 0, $row->{CompanyName});
}
and then later on in the code:
my $clientcombo = $bills_received->get_widget('SelectClient');
$clientcombo->set_popdown_strings(@$clientlist);
# Set up autocompletion in GTKEntry
$entrycompletion = Gtk2::EntryCompletion->new();
$entrycompletion->set_model($liststore);
$bills_received->get_widget('SelectClient_Entry')->set_completion($entrycompletion);
The code runs, and my combo box gets the values OK, but the GTKEntry
doesn't do autocompletion O:-)
Sorry. I swear - once I get this working I should be OK to build other
stuff without the constant stream of questions.
--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak nusconsulting com au
website: http://www.nusconsulting.com.au
Title: CanIt Vote for ID 45217
The following links have been placed here by the
NUS Consulting internal spam filter
and are for use by NUS Consulting staff only.
Please ingore these links.
Spam
Not spam
Forget previous vote
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]