Re: Combox - show one column but two columns in popup

This is how I resolved my issue by connecting to notify::popup-shown signal. It seems really kludgey though (especially having to resize the window)


     if($widgetsm{tunefile}->get('popup-shown') ==1){
        ($w,$h)= $window->get_size;
           $widgetsm{tunefile}->pack_start ($renderer1, 'FALSE');
           $widgetsm{tunefile}->add_attribute ($renderer1, text => 1);
    elsif ($widgetsm{tunefile}->get('popup-shown') ==0){
        $widgetsm{tunefile}->pack_start ($renderer, 'FALSE');
        $widgetsm{tunefile}->add_attribute ($renderer, text => 0);

On 20 June 2017 at 00:59, Mike Martin <mike redtux org uk> wrote:
Is this possible?

ie I have a combobox based on a two column liststore
I want only the first column to be shown in the combobox, but both columns to be shown in the popup

The model is populated by an array of filename/directory name

I'm sure I must be missing something obvious



my $channel_file_model=Gtk3::TreeStore->new('Glib::String','Glib::String');

 -- list of files as below;
my @list;
my %dirdvb;
foreach my $prefix_conf (@prefix_conf){
#my $prefix_conf;
my (undef,$prefix_conf_sys,undef)=File::Basename::fileparse($prefix_conf);
#print 'prefix ',$prefix_conf_sys,"\n";
foreach my $prefix_conf_sys (keys %dirdvb){
        my @listi=`ls -1 $prefix_conf_sys`;
        foreach my $list1 (@listi){
             push @list, [$list1,$prefix_conf_sys]
--setup renderer - otherwise 2nd column doesnt show at all
my $renderer1 = Gtk3::CellRendererText->new;
       $channel_file_view->pack_start ($renderer1, 'TRUE');
       $channel_file_view->add_attribute ($renderer1, text => 1);
--finally add lines to combobox

sub add_combo {
    my ($combo,$val1,$val2,$chk)=@_;
    my $iter=$combo->append(undef);

    my $cnt=0;
        foreach my $val ($val1,$val2){

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