How to show alerts using GtkMessageDialog

c070637e29db8f28add497b845ac0153.png
1. create the layout with
GtkBox
, adding a
GtkLabel
,
GtkEntry
and a
GtkButton
;
2. connect the
GtkButton
click signal, to take action when click on button;
3. when click, get the
GtkEntry
text with
GtkEntry::get_text
;
4. to display a alert, create a
GtkMessageDialog
, configuring for what
GtkWidow
, the display mode, the
GtkMessageType
, the
GtkButtonsType
and the message;
5. run the dialog with
GtkMessageDialog::run
and wait this to be closed;
6. when the alert closed, call the
GtkMessageDialog::destroy
to free memory;