Re: Spontaneous background colors in treeview
On Thu, Oct 25, 2007 at 10:43:52AM -0600, Jeffrey Barish wrote: Kristian Rietveld wrote: When you sort a column in a tree view with = 3 columns, the sorted column is drawn with a background that is slightly darker than the default background (in the default theme it is a shade of grey). ?This is the default and correct behavior. What is the rationale for ignoring set_sort_indicator when the number of columns is less than 3? If I go to the trouble of setting the sort indicator, it seems to me that gtk should respect my desires and show it. If I don't want the sort indicator to appear when ncols 3, I could detect that condition myself. I am annoyed that the sort indicator disappears from my GUI when I present data that requires only 2 columns. The rationale is simple: if we don't do it, it gets confusing. In a GtkTreeView with two columns, of which one is sorted, you basically have a list that is two colors in half. You cannot tell which one is the highlight (of course, unless you know what the real default background color is). This issue got filed multiple times and in the end it was decided to fix it this way. regards, -kris. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Spontaneous background colors in treeview
Kristian Rietveld wrote: When you sort a column in a tree view with = 3 columns, the sorted column is drawn with a background that is slightly darker than the default background (in the default theme it is a shade of grey). This is the default and correct behavior. What is the rationale for ignoring set_sort_indicator when the number of columns is less than 3? If I go to the trouble of setting the sort indicator, it seems to me that gtk should respect my desires and show it. If I don't want the sort indicator to appear when ncols 3, I could detect that condition myself. I am annoyed that the sort indicator disappears from my GUI when I present data that requires only 2 columns. -- Jeffrey Barish ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Spontaneous background colors in treeview
Andrew Cowie wrote: On Wed, 2007-10-10 at 19:45 -0600, Jeffrey Barish wrote: I believe that the manual is wrong when it says that an arrow appears. One most certainly does appear when you click on the header to sort. Do you have gtk_tree_view_column_set_headers_visible() set to true? That's where the arrow shows up. *(assuming you have a proper Linux distro that maintains GNOME properly and that you are using a sane and maintained theme) AfC San Francisco Sure (it is set in Glade) -- and the headers are visible. But no arrows. This is on Ubuntu 7.04 with the default theme. On another platform, I see arrows but no shading -- exactly the reverse of what I get on Ubuntu. I am satisfied with just the shading on Ubuntu, although I am curious about the discrepancy with your observations. -- Jeffrey Barish ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Spontaneous background colors in treeview
Mikael Hallendal wrote: Would it be possible to provide a screenshot that shows the problem you are seeing? It now appears that I fell victim to misleading documentation. The reference manual says that setting the sort indicator to true causes an arrow to appear in the header button indicating the column is sorted. On my system I see no arrow. Instead, the column is shaded. I believe that the manual is wrong when it says that an arrow appears. The second problem is an ambiguity in the manual. The statement describing the effect of setting the sort indicator to true seems to imply that the arrow will not appear if the column is not sorted. This interpretation prompted me to set the sort indicator on all columns with the expectation that the arrow would appear only on the one that was sorted. What actually happens when one sets the sort indicator is that the column is shaded, so setting the sort indicator on all columns results in what looks like a colored background. I suspect that I am supposed to set the sort indicator manually on the appropriate column (and only that column) whenever I switch sort column. -- Jeffrey Barish ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Spontaneous background colors in treeview
On Wed, 2007-10-10 at 19:45 -0600, Jeffrey Barish wrote: I believe that the manual is wrong when it says that an arrow appears. One most certainly does appear when you click on the header to sort. Do you have gtk_tree_view_column_set_headers_visible() set to true? That's where the arrow shows up. *(assuming you have a proper Linux distro that maintains GNOME properly and that you are using a sane and maintained theme) AfC San Francisco ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Spontaneous background colors in treeview
4 okt 2007 kl. 06.26 skrev Jeffrey Barish: Hik Kristian Rietveld wrote: Hi, On Mon, Oct 01, 2007 at 11:30:58AM -0600, Jeffrey Barish wrote: Stop presses. It's the number of columns. All data sets that require 3 columns have a background. All data sets that require 2 columns do not. Here it is. If I comment out the line that sets the sort indicator, I do not get the colored background for any data set. I thought you meant the rows had alternating background colors in your previous mails. When you sort a column in a tree view with = 3 columns, the sorted column is drawn with a background that is slightly darker than the default background (in the default theme it is a shade of grey). This is the default and correct behavior. I did mean the rows. With 3 columns (or more, perhaps -- my data sets never require more than 3 so I don't know) and with set sort indicator set to true, I get alternating *rows* of color. With 2 columns and with set sort indicator set to true, the background is white. With set sort indicator set to false, the background is white for any number of columns. Would it be possible to provide a screenshot that shows the problem you are seeing? Cheers, Mikael Hallendal -- Imendio AB, http://www.imendio.com ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Spontaneous background colors in treeview
Hi, On Mon, Oct 01, 2007 at 11:30:58AM -0600, Jeffrey Barish wrote: Stop presses. It's the number of columns. All data sets that require 3 columns have a background. All data sets that require 2 columns do not. Here it is. If I comment out the line that sets the sort indicator, I do not get the colored background for any data set. I thought you meant the rows had alternating background colors in your previous mails. When you sort a column in a tree view with = 3 columns, the sorted column is drawn with a background that is slightly darker than the default background (in the default theme it is a shade of grey). This is the default and correct behavior. regards, -kris. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Spontaneous background colors in treeview
Kristian Rietveld wrote: Hi, On Mon, Oct 01, 2007 at 11:30:58AM -0600, Jeffrey Barish wrote: Stop presses. It's the number of columns. All data sets that require 3 columns have a background. All data sets that require 2 columns do not. Here it is. If I comment out the line that sets the sort indicator, I do not get the colored background for any data set. I thought you meant the rows had alternating background colors in your previous mails. When you sort a column in a tree view with = 3 columns, the sorted column is drawn with a background that is slightly darker than the default background (in the default theme it is a shade of grey). This is the default and correct behavior. I did mean the rows. With 3 columns (or more, perhaps -- my data sets never require more than 3 so I don't know) and with set sort indicator set to true, I get alternating *rows* of color. With 2 columns and with set sort indicator set to true, the background is white. With set sort indicator set to false, the background is white for any number of columns. -- Jeffrey Barish ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Spontaneous background colors in treeview
Kristian Rietveld wrote: To get the alternating colors you would set the rules-hint property on GtkTreeView to TRUE (the default is FALSE). If you do not set this property to TRUE, the background should always be a solid color. Also note that rules-hint is only a hint to the theme engine; if the theme engine sets the allow-rules style property to FALSE (the default is TRUE) the colors will not be alternating. The application always has the final call about showing alternating colors, if the application sets rules-hint to FALSE and the theme still shows alternating colors, the theme is broken and needs to be fixed. The rules-hint property is always False in the TreeView regardless of which data set I display. If I set rules-hint to True, I do indeed get alternating colors in the background with all data sets. However, the colors are darker for the data sets that had alternating colors already. From your last statement, I conclude that the Ubuntu theme is broken. I gather that the reason I do not get alternating colors in the background of the treeview on the other platform with exactly the same code is that the theme on that platform is not broken. Because the background comes and goes depending on the data I display, it must be that something in the data is provoking the defect in the theme. If I can find out what that is, perhaps I will have a clue how to fix the theme. Stop presses. It's the number of columns. All data sets that require 3 columns have a background. All data sets that require 2 columns do not. Here it is. If I comment out the line that sets the sort indicator, I do not get the colored background for any data set. -- Jeffrey Barish ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Spontaneous background colors in treeview
On Sun, Sep 30, 2007 at 11:08:05AM -0600, Jeffrey Barish wrote: After making some changes to my program (not directly related to the GUI), I find that one treeview has a background of alternating light and dark bands, but only for certain data sets. I never set the background in my code, so I expect it to be white for every data set. The program has this behavior only under Ubuntu. On another platform, I do get a white background for all data sets (with the same code). Does anyone have a clue what might be causing this bizarre behavior? Can it be http://library.gnome.org/devel/gtk/stable/GtkTreeView.html#GtkTreeView--rules-hint http://library.gnome.org/devel/gtk/stable/GtkTreeView.html#GtkTreeView--allow-rules ? The alternating colors are controlled by the theme then. Yeti -- http://gwyddion.net/ ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Spontaneous background colors in treeview
On Sun, Sep 30, 2007 at 11:08:05AM -0600, Jeffrey Barish wrote: After making some changes to my program (not directly related to the GUI), I find that one treeview has a background of alternating light and dark bands, but only for certain data sets. I never set the background in my code, so I expect it to be white for every data set. The program has this Note that the theme controls the background color of the tree view; the background color in the default theme happens to be white. behavior only under Ubuntu. On another platform, I do get a white background for all data sets (with the same code). Does anyone have a clue what might be causing this bizarre behavior? If I wanted to set the background of the treeview to alternating light and dark bands, how would I do that? I find that modify_bg on the treeview does nothing (although To get the alternating colors you would set the rules-hint property on GtkTreeView to TRUE (the default is FALSE). If you do not set this property to TRUE, the background should always be a solid color. Also note that rules-hint is only a hint to the theme engine; if the theme engine sets the allow-rules style property to FALSE (the default is TRUE) the colors will not be alternating. The application always has the final call about showing alternating colors, if the application sets rules-hint to FALSE and the theme still shows alternating colors, the theme is broken and needs to be fixed. regards, -kris. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list