comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Tree widget woes
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Tree widget woes [message #37490 is a reply to message #37425] Mon, 22 December 2003 13:09 Go to previous message
robert.dimeo is currently offline  robert.dimeo
Messages: 42
Registered: November 2001
Member
robert.dimeo@nist.gov (Rob Dimeo) wrote in message news:<cb539436.0312180513.60ecac74@posting.google.com>...
> robert.dimeo@nist.gov (Rob Dimeo) wrote in message news:<cb539436.0312150649.442558b5@posting.google.com>...
>> robert.dimeo@nist.gov (Rob Dimeo) wrote in message news:<cb539436.0312120837.5f2aa843@posting.google.com>...
>
>>
>> So I guess I'll reply to my own posting with a workaround (the silence
>> was deafening...anyone else out there using the tree widgets?). The
>> code below shows how I implemented the workaround. The idea is to add
>> a folder (node) at the root level and make all additional folders
>> children of that one. I would rather not have to put in the root
>> folder but it's the only fix that I could come up with.
>
> Hi again,
>
> The good folks at RSI have contacted me that this is indeed a bug and
> is being investigated.
>
> Rob

Hi again,

Thanks to the technical support at RSI for pointing out a workaround
for the tree widget problem. The workaround is to de-select the
entire tree widget prior to adding a new node. The modified code with
this workaround is listed below. Also they indicate that this bug is
fixed in 6.1.

Rob

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
pro tt_add_folder,event
file_tree = widget_info(event.top,find_by_uname = 'FILE_TREE')
; Here comes the workaround....
widget_control, file_tree, set_tree_select = 0
; That's all there is to it!
group = widget_tree(file_tree,value = 'Data Group',/folder,$
/expanded)
leaf1 = widget_tree(group, value = 'Data')
leaf2 = widget_tree(group, value = 'Data')
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
pro tt_event,event
uname = widget_info(event.id,/uname)
case uname of
'QUIT': widget_control,event.top,/destroy
'ADD_FOLDER': tt_add_folder,event
else:
endcase
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
pro tree_widget_test,mult = mult
if n_elements(mult) eq 0 then mult = 0
register_name = 'tw_test'
tlb = widget_base(title = 'Tree Widget Test',/col,/tlb_frame_attr)
tree_base = widget_base(tlb,/col)
file_tree = widget_tree(tree_base,multiple = mult,uname = 'FILE_TREE')

group = widget_tree(file_tree,value = 'Data Group',/folder,$
/expanded)
leaf1 = widget_tree(group, value = 'Data')
leaf2 = widget_tree(group, value = 'Data')
void = widget_button(tlb,value = 'ADD FOLDER',uname = 'ADD_FOLDER')
void = widget_button(tlb,value = 'QUIT',uname = 'QUIT')
widget_control,tlb,/realize
xmanager,register_name,tlb,/no_block,event_handler = 'tt_event'
end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: test, please ignore
Next Topic: Re: Array has too many elements?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Mon Oct 27 03:09:02 PDT 2025

Total time taken to generate the page: 0.03332 seconds