This is the signature of callbacks that can be passed to
nd_dialog_filesel() and that gets called when the user
clicks "OK".
filename :
the filename the user selected.
user_data :
arbitrary user data.
ND_DialogCallback ()
void (*ND_DialogCallback) (void *user_data);
This is the signature of the generic callbacks used in the dialogs.
Also used in the generic number and address dialogs for
the "Cancel" callbacks, where the user can clean up any
user_data if necessary.
Shows a yes-no-cancel dialog and calls the appriopriate callback
when a button is clicked. The dialog is displayed and hidden
automatically. You can pass NULL for callbacks you don't need.
The function shows a simple message dialog with an okay
button. No callbacks. If modal is TRUE, no other windows
will be active while the dialog is shown.
The function shows a number-editing dialog with the given label
and initial value. The largest possible value is given through
max. You can pass NULL for callback_cancel if you don't need it.
The dialog also handles 32-bit values nicely, in contrast to
GTK's entry widget.
message :
message content.
base :
whether to initially use hex or decimal display.
value :
initial value to display.
max :
maximum value allowed.
callback_okay :
callback called when user clicks "okay"-button.
callback_cancel :
callback called when user clicks "cancel"-button.
packet :
currently edited packet, passed through to callbacks.
The function shows a generic hardware address entry dialog
that allows you to edit an address with the given address_len
(in bytes, e.g. 6 for Ethernet). When the "okay"-button is clicked,
callback_ok is called with the new value. You can pass NULL
for callback_cancel if you don't need it.
The function shows a dialog to edit an IPv4 address. This is
needed sufficiently often that it is provided withing Netdude
itself, not by a plugin. The ip_address memory is not used
internally. You can pass NULL for callback_cancel if you
don't need it.
The function shows a file selection dialog, initialized to
file_name, if provided. You can also pass NULL for file_name.
callback_fname if called when the user clicks the "okay"-button.
title :
text displayed in window title.
file_name :
initial file/directory name to display.
callback_fname :
callback called when user clicks "okay"-button.
user_data :
arbitrary user data.
nd_dialog_exit ()
void nd_dialog_exit (void);
This function opens the exit dialog, which shows a list of unsaved
files, which the user can save directly from the dialog before
Netdude exits.
This function is the most generic way to generate a dialog, allowing you
to basically specify all parts of it. The varargs specify the
buttons and must be a sequence of char*s for buttons labels and
ND_DialogCallbacks for the button callbacks.
type :
type of the dialog, determines what icon is displayed in dialog.
title :
text displayed in window title.
message :
message content.
modal :
whether dialog is modal or not.
extra_area :
arbitrary widget that is hooked into the dialog.
user_data :
arbitrary user data passed through to callbacks.
num_buttons :
number of buttons passed as varargs.
... :
sequence of button labels and callbacks.
nd_dialog_about ()
void nd_dialog_about (void);
The function displays Netdude's About-dialog, containing
version and author info etc.