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

Re: drag/drop after sort



muppet <scott asofyet org> writes:
> Can you post some code so that i can play with something resembling 
> what you have?

Here is a context diff for examples/simplelist.pl that makes
the first 2 columns sortable if you check the sortable box:

*** simplelist.pl	Fri Dec 31 20:50:53 2004
--- simplelist.pl.orig	Fri Dec 31 20:45:58 2004
***************
*** 152,168 ****
  $vbox->pack_start ($chk, 0, 0, 0);
  $tooltips->set_tip ($chk, 'set whether the list is reorderable');
  
- # toggle the column sortability
- $chk = Gtk2::CheckButton->new ('sortable');
- $chk->set_active (0);
- $chk->signal_connect (toggled => sub {
- 			# Make first 2 columns sortable
- 			$slist->get_column (0)->set_sort_column_id (0);
- 			$slist->get_column (1)->set_sort_column_id (1);
- 		      });
- $vbox->pack_start ($chk, 0, 0, 0);
- $tooltips->set_tip ($chk, 'set whether the list is reorderable');
- 
  # finally, a button to end it all
  $btn = Gtk2::Button->new_from_stock ('gtk-quit');
  $btn->signal_connect (clicked => sub  { Gtk2->main_quit; });
--- 152,157 ----
If you check both reorderable and sortable then click one
of the first 2 columns, you'll see the problem.

-- 
Dan Espen                           E-mail: dane mk telcordia com


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