Hobby-hacking Eric

2006-01-22

There was some interest in the GUI by a user on #darcs today. I estimated that it would take me till next weekend to get something functional out the door. Maybe that's a little optimistic.

Don't know what I'm doing. Trying to produce a universal patch viewing control that could be shared by Record and Whatsnew. What would be nice is to be able to select a patch (Record) as well as to collapse its view (Whatsnew) and do other cool stuff like select all the patches for a given file. What I have in mind is some kind of fancy tree-checkbox widget where each tree item is associated with a checkbox. If that's not possible, i'd like to be able to select multiple items in the tree, but setting wxTR_EXTENDED does not seem to help.

Hrmmph.

Made some discoveries in how wxWidgets works. Namely,
  • treeCtrl comes with its own scrolled window. I wonder if there's an easy way to get a non-scrolled treeCtrl, because then maybe I could simulate my tree-of-checkboxes idea
  • I had been stupid about how I used treeCtrlAppendItem. I was zipping around trying to append to a given node number. Just assumed that one of the Int arguments was a node position, but in fact, it has nothing to do with that. It's just a position in the image list. Each tree node can be associated with an image, and when you append the item, you can specify what its image is. Perhaps I could use this image functionality to represent selected and unselected item. After all, the append functions take arguments for the image when it's selected and when it's not.


I need to remember not to fixate on treeCtrl. The original source code had a nice simple idea where clicking on a patch would toggle it between summary and full size. But it's just that there's this issue with wxhaskell where resized widgets do not retain their new size... so that's a blocker.

Also having some trouble with the Record gui. Some resize bug somewhere. The button bar is hidden when you resize the window, and reappears sometimes. Weird. Will have to compare with code from my projects at work to see why my stuff behaves better.


No comments:

Blog Archive