This is our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Hi everybody I tried to show a window containing a message using TextWindow.new() but it always gave me a message that tshark stopped working when I run the file, the try is in a lua file that doesn't containing anything except TextWindow.new() and its method functions like append and so on, What's the problem? I did this because I wanted to try it alone before I merge it inside a big lua file. By the way my os is vista. Thanks a lot.

asked 16 Dec '12, 07:37

Leena's gravatar image

Leena
51171821
accept rate: 0%


What's the problem?

TextWindow.new and tshark? How would tshark open a new Window? That function is only usable within Wireshark. You can check for gui support with gui_enabled(), see the following example.

http://wiki.wireshark.org/Lua/Examples

Regards
Kurt

permanent link

answered 16 Dec '12, 13:06

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%

Is this(the message I got) what is meant by helloworld answers:

-- If not running from Wireshark, enable the tap immediately, then

-- abort, or else we'll get an error below for trying to do GUI

-- stuff from the command line.

in the question:http://ask.wireshark.org/questions/9682/trigger-an-executable-file-once-wireshark-finds-a-keyword-on-live-capture

?? Thanks.

(17 Dec '12, 23:43) Leena

In the answer of @helloworld you can see, that the code checks if the GUI is available. If no, it takes a different route.

if not gui_enabled() then make_tap(_filter) return end

So, you'll have to do similar things in your code. If the LUA script runs in tshark, you can't open a GUI window, as that is not possible.

(18 Dec '12, 00:40) Kurt Knochner ♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×832
×431

question asked: 16 Dec '12, 07:37

question was seen: 1,940 times

last updated: 20 Dec '12, 07:24

p​o​w​e​r​e​d by O​S​Q​A