I'm running on the nightly build. I noticed that for Qt version (either Mac or Windows), when I click on the part of the tree that I have written a dissector for, the tree is collapsed as default and you can expand it as you wish. However, for the GTK+ version (Windows), once you click on my protocol, it expands to the deepest level, which is a bit annoying. I haven't found out a way to change this. Is there a way I can make this all collapsed at the start? asked 01 Apr '14, 10:09 YXI edited 04 Apr '14, 17:00 Hadriel |
2 Answers:
If you're getting this behavior when using a Lua script, I think this will happen if you use That's not illegal/wrong, but this is the behavior you'll get with that for the reason Bill Meier cited: internally the wireshark C-code needs a registered To avoid this behavior, simply create and register [Qt should have given the same behavior - if it doesn't that's a bug I think.] answered 02 Apr '14, 19:51 Hadriel You guys hit the nail on the head! Yes, I'm using the TvbRange as the first argument in tree:add() I do need to change to using ProtoField as the first argument as that will make my value filterable as well. (03 Apr '14, 07:30) YXI |
Are you using the same 'ett' variable for each level (subtree) ? If so, that will give exactly the effect you describe (at least using GTK). If this is the problem, it would appear that there's something different (from GTK Wireshark) about the Wireshark implementation of trees when using QT (which might possibly be a bug). (An ett variable keeps track of whether the associated sub-tree is expanded or not; if only a single variable is used for all the sub-trees, then expanding one sub-tree effectively expands all the sub-trees). answered 02 Apr '14, 19:33 Bill Meier ♦♦ Hello guys as per above answers and comments my below script should work and show only level_1 children only but behaves same as older one
(18 May ‘15, 23:38) ankit I don’t know why ankit has posted my code https://ask.wireshark.org/questions/42404/lua-dissector-tree-collapse What’s the scope of his answer :O ? (19 May ‘15, 04:18) Peter1969 Hi peter I have also the same doubt. I have developed one plugin using lua ans same problem has occured as you have mentioned in your question. I have just reused your code to ask doubt nothing else let’s see what answer will be given??!! (19 May ‘15, 08:32) ankit @Hadriel can you look into this? (20 May ‘15, 09:44) ankit Answered in the original question. (27 Jun ‘15, 19:21) Hadriel |
Do you mean when you click on the + to expand a tree (in Gtk+) it automatically expands all subtrees?
Or do you mean that after doing that and then moving to another frame that contains your protocol all the subtrees are expanded?
I mean when you click on the + to expand a tree (in GTK+), instead of expanding one step down, just to the children level, it expands to children, grandchildren, great-grandchildren, all the way to the leave level of the entire subtree you clicked on.
That's very odd. I don't see that behavior here. I'm on Linux and I tried with both Gtk2 and Gtk3.
Does it happen for other protocols as well or just yours?
What about the stable (1.10.x) version?
Seems just to happen for my own protocol which is dissected by my script. Haven't tried on a 1.10.x version.