Etk
Main Page Object Hierarchy Data Structures Related Pages
Etk

Etk_Message_Dialog


Detailed Description

Etk_Message_Dialog is a convenient way to ask or to warn the user.

message_dialog.png
A message dialog can have several type (see Etk_Message_Dialog_Type), each type corresponding to a title and to an icon.
Several common predefined sets of buttons can be used by the message dialog (see Etk_Message_Dialog_Buttons), but you can also use ETK_MESSAGE_DIALOG_NONE and add your own buttons with etk_dialog_button_add().

Object Hierarchy:
  • Etk_Object
    • Etk_Widget
      • Etk_Container
        • Etk_Bin
          • Etk_Toplevel
            • Etk_Window
              • Etk_Dialog
                • Etk_Message_Dialog
Properties:
  • "message-type": The type of the dialog's message which defined the title and the icon
    • Type: Integer (Etk_Message_Dialog_Type)
    • Access: Read/Write
    • Default Value: ETK_MESSAGE_DIALOG_INFO
  • "buttons": The set of buttons used by the message dialog
    • Type: Integer (Etk_Message_Dialog_Buttons)
    • Access: Read/Write
    • Default Value: ETK_MESSAGE_DIALOG_NONE
  • "text": The text of the message dialog
    • Type: String (char *)
    • Access: Read/Write
    • Default Value: NULL


Data Structures

struct  Etk_Message_Dialog
 [Widget] The structure of a message dialog More...

Defines

#define ETK_MESSAGE_DIALOG_TYPE   (etk_message_dialog_type_get())
#define ETK_MESSAGE_DIALOG(obj)   (ETK_OBJECT_CAST((obj), ETK_MESSAGE_DIALOG_TYPE, Etk_Message_Dialog))
#define ETK_IS_MESSAGE_DIALOG(obj)   (ETK_OBJECT_CHECK_TYPE((obj), ETK_MESSAGE_DIALOG_TYPE))

Enumerations

enum  Etk_Message_Dialog_Type {
  ETK_MESSAGE_DIALOG_INFO,
  ETK_MESSAGE_DIALOG_WARNING,
  ETK_MESSAGE_DIALOG_QUESTION,
  ETK_MESSAGE_DIALOG_ERROR
}
 The type of the message of the dialog. More...
enum  Etk_Message_Dialog_Buttons
 Some common sets of buttons for the message dialog. To use your own buttons, you can use ETK_MESSAGE_DIALOG_NONE and add your buttons with etk_dialog_button_add(). More...

Functions

Etk_Widget * etk_message_dialog_new (Etk_Message_Dialog_Type message_type, Etk_Message_Dialog_Buttons buttons, const char *text)
 Creates a new message dialog.
void etk_message_dialog_message_type_set (Etk_Message_Dialog *dialog, Etk_Message_Dialog_Type type)
 Sets the type of the dialog's message. It will change the title and the icon of the message dialog.
Etk_Message_Dialog_Type etk_message_dialog_message_type_get (Etk_Message_Dialog *dialog)
 Gets the type of the dialog's message.
void etk_message_dialog_buttons_set (Etk_Message_Dialog *dialog, Etk_Message_Dialog_Buttons buttons)
 Sets the message dialog's buttons. To add your own buttons, use ETK_MESSAGE_DIALOG_NONE and add them with etk_dialog_button_add().
Etk_Message_Dialog_Buttons etk_message_dialog_buttons_get (Etk_Message_Dialog *dialog)
 Gets the set of buttons used by the message dialogs.
void etk_message_dialog_text_set (Etk_Message_Dialog *dialog, const char *text)
 Sets the message dialog's text.
const char * etk_message_dialog_text_get (Etk_Message_Dialog *dialog)
 Gets the message dialog's text.


Define Documentation

#define ETK_MESSAGE_DIALOG_TYPE   (etk_message_dialog_type_get())

Gets the type of a message dialog

#define ETK_MESSAGE_DIALOG ( obj   )     (ETK_OBJECT_CAST((obj), ETK_MESSAGE_DIALOG_TYPE, Etk_Message_Dialog))

Casts the object to an Etk_Message_Dialog

#define ETK_IS_MESSAGE_DIALOG ( obj   )     (ETK_OBJECT_CHECK_TYPE((obj), ETK_MESSAGE_DIALOG_TYPE))

Checks if the object is an Etk_Message_Dialog


Enumeration Type Documentation

enum Etk_Message_Dialog_Type

The type of the message of the dialog.

Enumerator:
ETK_MESSAGE_DIALOG_INFO  Informational message
ETK_MESSAGE_DIALOG_WARNING  Warning message
ETK_MESSAGE_DIALOG_QUESTION  Question message
ETK_MESSAGE_DIALOG_ERROR  Error message

enum Etk_Message_Dialog_Buttons

Some common sets of buttons for the message dialog. To use your own buttons, you can use ETK_MESSAGE_DIALOG_NONE and add your buttons with etk_dialog_button_add().


Function Documentation

Etk_Widget * etk_message_dialog_new ( Etk_Message_Dialog_Type  message_type,
Etk_Message_Dialog_Buttons  buttons,
const char *  text 
)

Creates a new message dialog.

Returns:
Returns the new message dialog widget

void etk_message_dialog_message_type_set ( Etk_Message_Dialog *  dialog,
Etk_Message_Dialog_Type  type 
)

Sets the type of the dialog's message. It will change the title and the icon of the message dialog.

Parameters:
dialog a meesage dialog
type the type to set

Etk_Message_Dialog_Type etk_message_dialog_message_type_get ( Etk_Message_Dialog *  dialog  ) 

Gets the type of the dialog's message.

Parameters:
dialog a dialog
Returns:
Returns the type of the dialog

void etk_message_dialog_buttons_set ( Etk_Message_Dialog *  dialog,
Etk_Message_Dialog_Buttons  buttons 
)

Sets the message dialog's buttons. To add your own buttons, use ETK_MESSAGE_DIALOG_NONE and add them with etk_dialog_button_add().

Parameters:
dialog a dialog
buttons the type of the buttons

Etk_Message_Dialog_Buttons etk_message_dialog_buttons_get ( Etk_Message_Dialog *  dialog  ) 

Gets the set of buttons used by the message dialogs.

Parameters:
dialog a dialog
Returns:
Returns the set of the buttons used

void etk_message_dialog_text_set ( Etk_Message_Dialog *  dialog,
const char *  text 
)

Sets the message dialog's text.

Parameters:
dialog a dialog
text the text to set

const char * etk_message_dialog_text_get ( Etk_Message_Dialog *  dialog  ) 

Gets the message dialog's text.

Parameters:
dialog a dialog
Returns:
Returns the text of the message dialog