Re: [gtk-list] Re: file selection widget design problem?



Here's one solution to "double clicking on a selected item in the file
selection dialog should not de-select the item" problem.  Sorry for the
length of this email, But i want to have this solution critiqued, so i
need to clearly describe the side effects.


edit line 2970 of file .../gtk+-1.0.4/gtk/gtkclist.c (in function
toggle_row)

FROM:

   if (selected_row && selected_row->state == GTK_STATE_SELECTED)

TO BE:

   if (selected_row && 
     selected_row->state == GTK_STATE_SELECTED && 
     event->type == GDK_BUTTON_PRESS)



Here's a breakout of events after this modification.  You'll see that
there are now extra select and unselect events when double clicking, and
they are not always in the same order depending on if the item was
selected or not beforehand.  Is this acceptable?  It does not seem to
negatively effect the gimp (and it feels A LOT better).

Note: An unselect_event method was attached to the clists in filesel.c,
and print statements were added to both the select and unselect methods
to produce the following output.  Remember that the file selection
clists are in SINGLE SELECTION mode. 



(Nothing selected)

* Click once on first entry in list:
   Select Event: row 0, 1 Click

(First row is selected)

* Click once on first entry in list:
   UNselect Event: row 0, 1 Click

(Nothing selected)

* Click twice on first entry in list:
   Select Event: row 0, 1 Click
   UNselect Event: row 0, 1 Click
   Select Event: row 0, 2 Clicks  [filename is printed]

(First row is selected)

* Click twice on first entry in list:  (note different order)
   UNselect Event: row 0, 1 Click
   Select Event: row 0, 1 Click
   Select Event: row 0, 2 Clicks  [filename is printed]

(First row is selected)

* Click once on second entry in list:
   UNselect Event: row 0, 1 Click
   Select Event: row 1, 1 Click

(Second row is selected)

* Click twice on third entry in list:
   UNselect Event: row 1, 1 Click
   Select Event: row 2, 1 Click
   UNselect Event: row 2, 1 Click
   Select Event: row 2, 2 Clicks  [filename is printed]

(Third row is selected)

* TRIPLE click on third entry in list:
   UNselect Event: row 2, 1 Click
   Select Event: row 2, 1 Click
   Select Event: row 2, 2 Clicks  [filename is printed]
   UNselect Event: row 2, 1 Click
   Select Event: row 2, 3 Clicks


~p@



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