Re: Widget tree bug [message #63987] |
Tue, 25 November 2008 15:07 |
Robbie
Messages: 165 Registered: February 2006
|
Senior Member |
|
|
I know that this is a petty bug, but after some careful thinking, I
replicated it and found a workaround. In the example code below the
frist time that the first node in the tree is selected, the selection
is moved to the third node. It seems that the user cannot reselect the
first node unless I have the /MULTIPLE keyword set to widget tree. A
persitent user can reselect the first node by clicking a few times, or
selecting another node and then selecting the node they want.
pro rkbwidgetbug_event, ev
common rkbwidgetbug, tlb, tree_id, flag, one_id, two_id, three_id,
button_id, bug_fix
widget_control, ev.id, GET_VALUE=value
print, value
if ((ev.id eq one_id) and (flag)) then begin
wait, 0.1
if (bug_fix) then widget_control, one_id, SET_TREE_SELECT=0
widget_control, three_id, SET_TREE_SELECT=1
flag = 0
print, "Changed selected tree node, now try selecting the first
node again"
endif else begin
widget_control, ev.id, SET_TREE_SELECT=1
endelse
end
pro rkbwidgetbug
common rkbwidgetbug, tlb, tree_id, flag, one_id, two_id, three_id,
button_id, bug_fix
tlb = widget_base(COL=1)
flag = 1
bug_fix = 0
tree_id = widget_tree(tlb,MULTIPLE=bug_fix)
one_id = widget_tree(tree_id,VALUE="One")
two_id = widget_tree(tree_id,VALUE="Two")
three_id = widget_tree(tree_id,VALUE="Three")
button_id = widget_button(tlb,VALUE="Button")
widget_control, tlb,/REALIZE
xmanager, 'rkbwidgetbug', tlb
end
|
|
|