GtkDialog Class

The GtkDialog class is the class for instantiating dialog widgets.

The class heirarchy


   Object
      +---GtkWidget
         +---GtkContainer
            +---GtkDialog

The methods for the GtkDialog class are documented below.

GtkDialog Method Table of Contents

new - Create and initialize the widget
addactionbutton - Add an action button to the dialog
run - Run the dialog
timeout = - Set a timeout for the dialog
title - Get the title of the dialog
title = - Set the title of the dialog
vbox - Return the dialog's vbox pointer


Method: new

This method creates and initializes the widget.

Example

This is a example of how to create a new dialog widget.


title = 'Dialog Frame Title'
mydiag = .GtkDialog~new(title)

Method Parameters

title
(Optional) Title for the dialog.

Method Results

The new GtkDialog object.




Method: addactionbutton

This method add an action button to the action area of the dialog.

Example

This is a example of how to add an action button to a dialog.


text = 'gtk-ok'
response = 'GTK_RESPONSE_OK'
ok_button = dialog1~addactionbutton(text, response)

Method Parameters

text
The label text for the button. You can use the preassigned labels available. See the list in the GtkButton Class documentation
response
The response to be returned by the dialog's run method. Customized responses are not supported. You must use one of the following strings.

GTK_RESPONSE_REJECT
GTK_RESPONSE_ACCEPT
GTK_RESPONSE_OK
GTK_RESPONSE_CANCEL
GTK_RESPONSE_CLOSE
GTK_RESPONSE_YES
GTK_RESPONSE_NO
GTK_RESPONSE_APPLY
GTK_RESPONSE_HELP

Method Results

button
The new GtkButton object.



Method: run

This method runs the specified dialog widget. Control is not returned from this method until either an action button is pressed or the dialog is dismissed.

Example

This is a example of how to run a dialog.


response = mydialog~run()

Method Parameters

None.

Method Results

response
The response returned by the dialog. It will be one of the following strings.

GTK_RESPONSE_REJECT
GTK_RESPONSE_ACCEPT
GTK_RESPONSE_OK
GTK_RESPONSE_CANCEL
GTK_RESPONSE_CLOSE
GTK_RESPONSE_YES
GTK_RESPONSE_NO
GTK_RESPONSE_APPLY
GTK_RESPONSE_NONE
GTK_RESPONSE_HELP
GTK_RESPONSE_DELETE_EVENT

If a timeout is set for the dialog and it expires then this method will return the response GTK_RESPONSE_NONE.




Valid XHTML 1.0!


Method: timeout =

This method sets a timeout for the dialog widget. Setting a timeout will cause the dialog to be destroyed after the timeout expires.

Example

This is a example of how to set a timeout for a dialog.


seconds = 5
mydialog~settimeout = seconds

Method Parameters

seconds
The number of seconds until the timeout expires.

Method Results

None.




Method: title

This method gets the dialog widget's title.

Example

This is a example of how to retrieve the title from a dialog.


title = mydialog~title()

Method Parameters

None.

Method Results

title
The title of the dialog widget.



Method: title =

This method sets the dialog widget's title.

Example

This is a example of how to set the title of a dialog.


mydialog~title = 'My dialog title'

Method Parameters

title
The new title of the dialog widget.

Method Results

None.




Method: vbox

This method gets the dialog widget's vertical box widget object.

Example

This is a example of how to retrieve the vbox object from a dialog.


vboxptr = mydialog~vbox()

Method Parameters

None.

Method Results

vbox
The dialog widget's vbox object.



Valid XHTML 1.0!