Re: TreeView without a selection when rendered




On Dec 27, 2007, at 11:44 AM, Joaquim Schmidlap wrote:

Whenever I put a TreeView on a window, it appears with the top row
selected. I would like it to appear initially with no rows selected,
but still allow the user to make selections later.

I've tried get_selection()->unselect_all() in both on_realize and
on_show, but it doesn't work. I'm guessing whatever does the initial
selection happens after those events.

Is there a different event I can sneak in after to do this?

Well, I've kludged my way around the problem. In my derived TreeView, I connect to get_selection()->signal_changed() and check a boolean flag to see if it's the first selection after construction, and if so, unselect_all(). Fine for now, but it still seems to me there should be some message I can send the TreeView during or just after construction that just says "don't select anything, thanks."

More generally, a related question: it seems there are many steps in
rendering a widget: on_map, on_realize, on_show, etc. Is there a
definitive list of what all these events are, and in what order they
happen?

I would still appreciate any guidance anyone can offer in this area. If this question is ill-formed or I'm on the wrong list, I apologize. Any suggestion on how to reformat my question or where else I should look would be as welcome as a definitive answer...



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