Re: [gnome-db] I'm still alive and here



Iago Rubio wrote:

Hi Dru,

On Sat, 2005-03-19 at 20:55 +1300, Dru wrote:
I'm currently working on updating my gtk support and removing
everything thats depreciated from my projects.  Has anyone
had experence with GtkComboBox? I'm finding it less friendly
than the older GtkCombo code with lots of little issues.  Has
anyone else used it in databases and know how to make
combo boxes more user friendly to people who spend there
entire day entering records.  I modify the listings a lot
before display so i am not really interested in using something
that binds directly to a database object.

I'm reading your posts in the gtk-devel, and you should not expect too
much help there.

I recommend you to try the gtk-app-devel list, where - for sure - you'll
find more help.

From your posts I understand your problem is with the handling of the
currently selected cell in the drop down. It seems you want the
currently selected item to be visible on the drop down list.

If I'm right, I'm sure you will find those functions useful.

GtkTreeSelection* gtk_tree_view_get_selection (GtkTreeView *tree_view);

gboolean gtk_tree_selection_get_selected (GtkTreeSelection *selection,
                                GtkTreeModel **model,
                                GtkTreeIter *iter);

GtkTreePath*
gtk_tree_model_get_path        (GtkTreeModel *tree_model,
                               GtkTreeIter *iter);
void gtk_tree_view_scroll_to_cell (GtkTreeView *tree_view,
                                GtkTreePath *path,
                                // column can be NULL
GtkTreeViewColumn *column, // if FALSE alignment is not used
                                gboolean use_align,
				 // 0.0 left/top, 1.0 right/bottom, 0.5 center.
gfloat row_align, gfloat col_align);


The rationale can be: pick the current selection - an iter and model, both are return values on gtk_tree_selection_get_selected() -  take the path with gtk_tree_model_get_path() and scroll to the cell that path.

I hope I had undestood your problem.

Again, I recommend you to ask for help in the gtk-app-devel list. The gtk-devel is quite technical and about gtk internals. They don't use to help when asking about how gtk works.


Best Regards.

Thanks for the help. I still trying to get it going without much luck :(. I think the scroll to cell will work, though i am having problems extracting the treeview from a gtkcombobox, and modifying the gtk code so far has been unadventful for me so far. Its weird though because gtk_tree_view_set_selection is called in the gtk code but it isn't highlighting. Maybe its a styling thing. I really havn't played with gtk enough to know its internals. I'll ask on the gtk-app-devel list, maybe someone has experence with
GtkComboBox and selections etc.



--
Andrew Hill
treshna Enterprises Ltd
Tel: 03 366 3649
Cel: 021 660 819
Web: www.treshna.com




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