After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 322591 - tree_view->priv->search_dialog_position_func needs exposing
tree_view->priv->search_dialog_position_func needs exposing
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
2.8.x
Other Linux
: Normal normal
: ---
Assigned To: gtktreeview-bugs
gtktreeview-bugs
: 72280 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-11-27 20:36 UTC by Jonathan Blandford
Modified: 2011-02-04 16:10 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jonathan Blandford 2005-11-27 20:36:44 UTC
We originally intended the type-ahead dialog to be application movable, but
never added the API.
Comment 1 Matthias Clasen 2006-01-10 13:28:22 UTC
Hmm, how about 

typedef void (*GtkTreeViewSearchPositionFunc) (GtkTreeView *tree_view,
                                               GtkWidget   *search_dialog,
                                               gpointer     user_data);

void
gtk_tree_view_set_search_position_func (GtkTreeView                  *tree_view,
                                        GtkTreeViewSearchPositionFunc func,
                                        gpointer                      data,
                                        GDestroyNotify                destroy);

Note that this adds user_data, so we'll have to adjust current callers.
Do we also need

GtkTreeViewSearchPositionFunc
gtk_tree_view_get_search_position_func (GtkTreeView *tree_view);

?

Looking at gtk_tree_view_get_search_equal_func(), I notice it returns
a pointer to a static function if the default function is used. Is that
ok, or should it return NULL in that case ?
Comment 2 Matthias Clasen 2006-01-10 15:05:43 UTC
Oh, btw. Is this also supposed to allow reparenting the dialog to somewhere in else ?
Comment 3 Jonathan Blandford 2006-01-10 17:41:42 UTC
Yes, people have also wanted to support their own entries.  For example, a list with a search entry above it, in the widget heirarchy.
Comment 4 Matthias Clasen 2006-01-10 17:53:10 UTC
A simple search_position_func is not really suitable for achieving that, is it ?
Comment 5 Kristian Rietveld 2006-01-14 18:31:02 UTC
No; we need more than that.  We originally planned to add an option to pack the search entry in another container.  But maybe it is cleaner to have the user supply their own entry and have GtkTreeView connect signals the signals on it.

Adding _{set,get}_search_position_func() looks like a nice idea to me.  Next to that it might be nice to add something like:

  void gtk_tree_view_search_set_entry (GtkTreeView *tree_view, GtkEntry *entry);

which will then override the "built-in" popup window with entry.  Or maybe gtk_tree_view_search_{attach,detach}_entry()?

If we can settle on a name I can implement this ;)
Comment 6 Kristian Rietveld 2006-01-14 18:32:05 UTC
*** Bug 72280 has been marked as a duplicate of this bug. ***
Comment 7 Jonathan Blandford 2006-01-23 21:53:52 UTC
I might go with set_entry(entry)/set_entry(NULL); to set/unset the entry.  Otherwise, it looks good!
Comment 8 Kristian Rietveld 2006-01-24 10:50:04 UTC
CVS HEAD now has
gtk_tree_view_get_search_entry()
gtk_tree_view_set_search_entry()
gtk_tree_view_get_search_position_func()
gtk_tree_view_set_search_position_func()