pspp-dev
[Top][All Lists]
Advanced

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

gtk3: Replaced PsppSheetView with GtkTreeView for the variables window


From: Friedrich Beckmann
Subject: gtk3: Replaced PsppSheetView with GtkTreeView for the variables window
Date: Wed, 9 Dec 2015 20:19:02 +0100

Am 19.05.2015 um 14:11 schrieb John Darrington <address@hidden>:
> I'm hoping, that some future Gtk+ version will have a GtkTreeView widget 
> (or some other widget) which is flexible enough that we don't have to 
> maintain our own sheet widget.  If that happens, then most of the deprecation
> warning will go away.
> 

Hi John,

I replaced the PsppSheetView with GtkTreeView in the variables window to see 
how it looks. Basically it works but there are some differences in user 
interaction. The GtkTreeView expects a first click on the cell to select the 
cell and then another click to edit the cell. My implementation for the dialog 
windows for Type, Value Label and Missing is based on the row-activate signal 
and requires that one does a double click on the cell to open the dialog. This 
is then different compared to editing the text cells like NAME, where just one 
click to select and a second single click to start editing is required.  

It is possible to have the „activate“ also with just one click, but then this 
interferes with the selection process. Clicking on a TYPE cell to start the 
selection will open the dialog window. (See  
gtk_tree_view_set_activate_on_single_click in the data-editor.c changes)

It is also possible to start editing with just one click by using the activate 
callback to do gtk_tree_view_set_cursor. However this also interferes with the 
selection process. (see on_row_activated ).

I also thought about a new cell renderer for the dialog box type editing but 
the TYPE dialog box modifies data in several columns plus I am not too sure how 
I can end the editing inside the editing-started callback. Maybe this is not 
possible.

Anyway, using the GtkTreeView in the way it is supposed to be used is different 
in the way the editing is activated. My ideas to start editing with just one 
click resulted in problems with the selection process. Here is a video link to 
see the GtkTreeView based behavior with lousy sound: 
https://youtu.be/4xS0Beb0Gdo

Do you think we should change to GtkTreeView? 

Attached is the patch with my changes including debugging printfs. So if you 
want to try it… I did this on MacOS with gtk3 18.5.3 via macports.

Friedrich

Attachment: 0001-Moved-Variable-Window-from-PsppSheetView-to-GtkTreeV.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]