Gtk2hs inherits the current Gtk theme that is being used, so on my machine (Ubuntu - Human Theme) the selection backgrounds are orange, but if I were to change theme, it would change to that theme's default.
IMO, if you are writing something that people are going to use, you're probably best off leaving the default settings as it will then fit in with the way their computer is set up.
To learn how to use tree views, I am improving the ListDemo application
from the previous message. The attached image shows the current
In order to mark an item, the user should use the check box at the third
column of the row. Marked items are shown with an yellow background, so
that it becomes easy to see all the marked items.
The selected row uses a blue background (the default), even when the
item is marked. My first question is how to use another background in
this case (let's say, green)? In other words, how can I find if a row is
selected when it is drawn?
The first and second columns are editable. That means that the user can
change the values of the genre and of the translation for an item. But
the genre should be unique, so the program only accepts the modified
genre if it is not present in any other row of the list. There is no
such restriction for the translation.
The Add button adds a new row to the list, at the end, and starts
editing the first column (genre), allowing the user to type a genre. The
genre should be unique, so the program checks for its uniqueness before
accepting the new value.
The remove button removes the selected row from the list. This button is
sensitive only when a row is selected.
A would like to keep the list sorted by the first column. What would be
the best appoach for that: to keep the store list sorted, or use a
sorting proxy model, as suggested by the TreeSort.hs demo in the
If the original model is to be kept sorted, then in every update of the
genre field the selected row should be removed from the model, and a new
row with the new genre should be inserted at the right position. Also in
every addition of a new row, it should be inserted at the right position
in the model, in order to keep it sorted.
And a final issue I would solved. If the tree view is put inside a
scrolled window with automatic policy for the vertical scroll bar, and
no scrolling for the horizontal, not all rows are visible and the scroll
bar is used, as in can be seen in the second attached image. I would
like very much to see the scroll bar in action only if the window could
not be grown to make all the rows visible. That is, the window does not
have to be small only because I have allowed the use of a scroll
bar. The scroll bar should be used only as the last option to see the
rows when there is not enough screen space for the window. Can anything
be done in this direction?
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
Gtk2hs-users mailing list