Class: Gtk::NativeDialog

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#destroynil

Destroys a dialog.

When a dialog is destroyed, it will break any references it holds to other objects. If it is visible it will be hidden and any underlying window system resources will be destroyed.

Note that this does not release any reference to the object (as opposed to destroying a GtkWindow) because there is no reference from the windowing system to the Gtk::NativeDialog.

Returns:

  • (nil)

#hidenil

Hides the dialog if it is visilbe, aborting any interaction. Once this is called the Gtk::NativeDialog::response signal will not be emitted until after the next call to gtk_native_dialog_show().

If the dialog is not visible this does nothing.

Returns:

  • (nil)

Returns whether the dialog is modal. See gtk_native_dialog_set_modal().

Returns:

  • (TrueClass)

    true if the dialog is set to be modal

#modal=(modal) ⇒ TrueClass

Whether the window should be modal with respect to its transient parent.

Parameters:

  • modal (TrueClass)

Returns:

  • (TrueClass)

    modal

  • (TrueClass)

    modal

#modal?TrueClass

Whether the window should be modal with respect to its transient parent.

Returns:

  • (TrueClass)

    modal

#runInteger

Blocks in a recursive main loop until self emits the Gtk::NativeDialog::response signal. It then returns the response ID from the ::response signal emission.

Before entering the recursive main loop, gtk_native_dialog_run() calls gtk_native_dialog_show() on the dialog for you.

After gtk_native_dialog_run() returns, then dialog will be hidden.

Typical usage of this function might be:

gint result = gtk_native_dialog_run (GTK_NATIVE_DIALOG (dialog));
switch (result)
  {
    case GTK_RESPONSE_ACCEPT:
       do_application_specific_something ();
       break;
    default:
       do_nothing_since_dialog_was_cancelled ();
       break;
  }
g_object_unref (dialog);

Note that even though the recursive main loop gives the effect of a modal dialog (it prevents the user from interacting with other windows in the same window group while the dialog is run), callbacks such as timeouts, IO channel watches, DND drops, etc, will be triggered during a gtk_nautilus_dialog_run() call.

Returns:

  • (Integer)

    response ID

#shownil

Shows the dialog on the display, allowing the user to interact with it. When the user accepts the state of the dialog the dialog will be automatically hidden and the Gtk::NativeDialog::response signal will be emitted.

Multiple calls while the dialog is visible will be ignored.

Returns:

  • (nil)

#titleString

The title of the dialog window

Returns:

  • (String)

    title

#title=(title) ⇒ String

The title of the dialog window

Parameters:

  • title (String)

Returns:

  • (String)

    title

  • (String)

    title

#transient_forGtk::Window

The transient parent of the dialog, or nil for none.

Returns:

#transient_for=(transient_for) ⇒ Gtk::Window

The transient parent of the dialog, or nil for none.

Parameters:

Returns:

#visibleTrueClass

Determines whether the dialog is visible.

Returns:

  • (TrueClass)

    true if the dialog is visible

#visible=(visible) ⇒ TrueClass

Whether the window is currenlty visible.

Parameters:

  • visible (TrueClass)

Returns:

  • (TrueClass)

    visible

  • (TrueClass)

    visible

#visible?TrueClass

Whether the window is currenlty visible.

Returns:

  • (TrueClass)

    visible