GUI support

{i} It is highly recommended to make GUI code conditional on gui_enabled(). Otherwise, scripts containing GUI code will cause an error in tshark (or cause tshark to crash Bug 6018).


ProgDlg

A modal progress bar dialog. Intended to be used with coroutines, where a main UI thread controls the progress bar dialog while a background coroutine (worker thread) yields to the main thread between steps. The main thread checks the status of the STOP button and if it's not set, returns control to the coroutine.

function

description

ProgDlg.new([title] [,task])

Creates a new progress dialog and displays it

progdlg:update(progress [,task])

Sets the progress dialog's progress bar position based on percentage done

progdlg:stopped()

Checks whether the user has pressed the Stop button

progdlg:close()

Closes the progress dialog


ProgDlg.new([title] [,task])


progdlg:update(progress [,task])


progdlg:stopped()


progdlg:close()


TextWindow

A text window

function

description

TextWindow.new([title])

Creates a new text window and displays it

textwindow:set_atclose(action)

Sets the function that is called when the window closes

textwindow:set(text)

Sets the text of the dialog

textwindow:append(text)

Appends text to the current text of the dialog window

textwindow:prepend(text)

Prepends text to the current text of the dialog window

textwindow:clear()

Clears the text of the dialog window

textwindow:get_text()

Gets the current text of the dialog window

textwindow:set_editable([editable])

Sets the enabled status of the text window's edit area

textwindow:add_button(label, function)

Adds a button with an action handler to the text window


TextWindow.new([title])


textwindow:set_atclose(action)


textwindow:set(text)


textwindow:append(text)


textwindow:prepend(text)


textwindow:clear()


textwindow:get_text()


textwindow:set_editable([editable])


textwindow:add_button(label, function)


Non Method Functions

function

description

gui_enabled()

Checks whether the GUI facility is enabled (always false from tshark)

register_menu(name, action [,group])

Register a menu item in one of the main menus

new_dialog(title, action, field1 [,field2 ...])

Displays a dialog, prompting for input. The dialog includes an OK button and Cancel button.

retap_packets()

Rescans all packets and runs taps (aka listener) without reconstructing the display

copy_to_clipboard(text)

Copies a string into the clipboard

open_capture_file(filename, filter)

Opens and displays a capture file

set_color_filter_slot(index, dfilter)

Sets a packet-coloring rule (by index) for the current session

set_filter(dfilter)

Sets the text of the display filter textbox in the GUI (does not apply the filter)

apply_filter()

Applies the current text in the display filter textbox to the current capture

reload()

Reloads the current capture file

browser_open_url(url)

Opens an URL in a web browser

browser_open_data_file(filepath)

Opens a file (located in the data directory) in a web browser


gui_enabled()


register_menu(name, action [,group])


new_dialog(title, action, field1 [,field2 ...])


retap_packets()


copy_to_clipboard(text)


open_capture_file(filename, filter)


set_color_filter_slot(index, dfilter)


set_filter(dfilter)


apply_filter()


reload()


browser_open_url(url)


browser_open_data_file(filepath)

LuaAPI/GUI (last edited 2014-02-06 17:35:35 by HadrielKaplan)