+/* Set the properties of a tree view. */
+static void
+mswindows_tree_view_redisplay (Lisp_Object image_instance)
+{
+ /* This function can GC if IN_REDISPLAY is false. */
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+
+ if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii))
+ {
+ HWND wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii);
+ Lisp_Object rest;
+ HTREEITEM parent;
+ /* Delete previous items. */
+ SendMessage (wnd, TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT);
+ /* define a root */
+ parent = add_tree_item (image_instance, wnd, NULL,
+ XCAR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)),
+ TRUE, IMAGE_INSTANCE_DOMAIN (ii));
+
+ /* recursively add items to the tree view */
+ /* add items to the tab */
+ LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)))
+ {
+ if (LISTP (XCAR (rest)))
+ add_tree_item_list (image_instance, wnd, parent, XCAR (rest),
+ IMAGE_INSTANCE_DOMAIN (ii));
+ else
+ add_tree_item (image_instance, wnd, parent, XCAR (rest), FALSE,
+ IMAGE_INSTANCE_DOMAIN (ii));
+ }
+ }
+}
+