gtkmm 4.17.0
|
Integrate with native dialogs. More...
#include <gtkmm/nativedialog.h>
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
Protected Member Functions | |
NativeDialog () | |
There is no create() method that corresponds to this constructor, because only derived classes shall be created. | |
virtual void | on_response (int response_id) |
This is a default handler for the signal signal_response(). | |
![]() | |
Object () | |
Object (const Glib::ConstructParams &construct_params) | |
Object (GObject *castitem) | |
~Object () noexcept override | |
![]() | |
ObjectBase () | |
ObjectBase (const char *custom_type_name) | |
ObjectBase (const std::type_info &custom_type_info) | |
ObjectBase (ObjectBase &&src) noexcept | |
ObjectBase & | operator= (ObjectBase &&src) noexcept |
virtual | ~ObjectBase () noexcept=0 |
void | initialize (GObject *castitem) |
void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper) |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gtk::NativeDialog > | wrap (GtkNativeDialog *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
Additional Inherited Members | |
![]() | |
typedef void(*)(gpointer data | DestroyNotify) |
![]() | |
typedef internal::func_destroy_notify | func_destroy_notify |
![]() | |
typedef internal::func_destroy_notify | func_destroy_notify |
Integrate with native dialogs.
Native dialogs are platform dialogs that don't use Gtk::Dialog or Gtk::Window. They are used in order to integrate better with a platform, by looking the same as other native applications and supporting platform specific features.
The Gtk::Dialog functions cannot be used on such objects, but we need a similar API in order to drive them. The NativeDialog object is an API that allows you to do this. It allows you to set various common properties on the dialog, as well as show and hide it and get a response signal when the user finished with the dialog.
|
noexcept |
|
overridenoexcept |
|
protected |
There is no create() method that corresponds to this constructor, because only derived classes shall be created.
bool Gtk::NativeDialog::get_modal | ( | ) | const |
Returns whether the dialog is modal.
true
if the dialog is set to be modal. Glib::ustring Gtk::NativeDialog::get_title | ( | ) | const |
Gets the title of the Gtk::NativeDialog
.
nullptr
if none has been set explicitly. The returned string is owned by the widget and must not be modified or freed. Window * Gtk::NativeDialog::get_transient_for | ( | ) |
Fetches the transient parent for this window.
nullptr
if no transient parent has been set. Fetches the transient parent for this window.
nullptr
if no transient parent has been set.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
bool Gtk::NativeDialog::get_visible | ( | ) | const |
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GtkNativeDialog * Gtk::NativeDialog::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
void Gtk::NativeDialog::hide | ( | ) |
Hides the dialog if it is visible, aborting any interaction.
Once this is called the signal_response() signal will not be emitted until after the next call to show().
If the dialog is not visible this does nothing.
This is a default handler for the signal signal_response().
|
noexcept |
Glib::PropertyProxy< bool > Gtk::NativeDialog::property_modal | ( | ) |
Whether the window should be modal with respect to its transient parent.
Default value: false
Glib::PropertyProxy_ReadOnly< bool > Gtk::NativeDialog::property_modal | ( | ) | const |
Whether the window should be modal with respect to its transient parent.
Default value: false
Glib::PropertyProxy< Glib::ustring > Gtk::NativeDialog::property_title | ( | ) |
The title of the dialog window.
Default value: ""
Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::NativeDialog::property_title | ( | ) | const |
The title of the dialog window.
Default value: ""
Glib::PropertyProxy< Window * > Gtk::NativeDialog::property_transient_for | ( | ) |
The transient parent of the dialog, or nullptr
for none.
Glib::PropertyProxy_ReadOnly< Window * > Gtk::NativeDialog::property_transient_for | ( | ) | const |
The transient parent of the dialog, or nullptr
for none.
Glib::PropertyProxy< bool > Gtk::NativeDialog::property_visible | ( | ) |
Whether the window is currently visible.
Default value: false
Glib::PropertyProxy_ReadOnly< bool > Gtk::NativeDialog::property_visible | ( | ) | const |
Whether the window is currently visible.
Default value: false
Sets a dialog modal or non-modal.
Modal dialogs prevent interaction with other windows in the same application. To keep modal dialogs on top of main application windows, use set_transient_for() to make the dialog transient for the parent; most window managers will then disallow lowering the dialog below the parent.
modal | Whether the window is modal. |
void Gtk::NativeDialog::set_title | ( | const Glib::ustring & | title | ) |
Dialog windows should be set transient for the main application window they were spawned from.
This allows window managers to e.g. keep the dialog on top of the main window, or center the dialog over the main window.
Passing nullptr
for parent unsets the current transient window.
parent | Parent window. |
void Gtk::NativeDialog::show | ( | ) |
Shows the dialog on the display.
When the user accepts the state of the dialog the dialog will be automatically hidden and the signal_response() signal will be emitted.
Multiple calls while the dialog is visible will be ignored.
Glib::SignalProxy< void(int)> Gtk::NativeDialog::signal_response | ( | ) |
void on_my_response(int response_id)
Flags: Run Last
Emitted when the user responds to the dialog.
When this is called the dialog has been hidden.
If you call Gtk::NativeDialog::hide() before the user responds to the dialog this signal will not be emitted.
response_id | The response ID. |
void Gtk::NativeDialog::unset_transient_for | ( | ) |
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |