Geany dev
Functions
dialogs.h File Reference

File related dialogs, miscellaneous dialogs, font dialog. More...

Functions

gchar * dialogs_show_input (const gchar *title, GtkWindow *parent, const gchar *label_text, const gchar *default_text)
 Asks the user for text input. More...
 
gboolean dialogs_show_input_numeric (const gchar *title, const gchar *label_text, gdouble *value, gdouble min, gdouble max, gdouble step)
 Shows an input box to enter a numerical value using a GtkSpinButton. More...
 
void dialogs_show_msgbox (GtkMessageType type, const gchar *text,...)
 Shows a message box of the type type with text. More...
 
gboolean dialogs_show_question (const gchar *text,...)
 Shows a question message box with text and Yes/No buttons. More...
 
gboolean dialogs_show_save_as (void)
 Shows the Save As dialog for the current notebook page. More...
 

Detailed Description

File related dialogs, miscellaneous dialogs, font dialog.

Function Documentation

◆ dialogs_show_input()

gchar * dialogs_show_input ( const gchar *  title,
GtkWindow *  parent,
const gchar *  label_text,
const gchar *  default_text 
)

Asks the user for text input.

Parameters
titleDialog title.
parent The currently focused window, usually geany->main_widgets->window. NULL can be used but is discouraged due to window manager effects.
label_text Label text, or NULL.
default_text Text to display in the input field, or NULL.
Returns
New copy of user input or NULL if cancelled.
Since
0.20.

◆ dialogs_show_input_numeric()

gboolean dialogs_show_input_numeric ( const gchar *  title,
const gchar *  label_text,
gdouble *  value,
gdouble  min,
gdouble  max,
gdouble  step 
)

Shows an input box to enter a numerical value using a GtkSpinButton.

If the dialog is aborted, value remains untouched.

Parameters
titleThe dialog title.
label_textThe shown dialog label.
valueThe default value for the spin button and the return location of the entered value. Must be non-NULL.
minMinimum allowable value (see documentation for gtk_spin_button_new_with_range()).
maxMaximum allowable value (see documentation for gtk_spin_button_new_with_range()).
stepIncrement added or subtracted by spinning the widget (see documentation for gtk_spin_button_new_with_range()).
Returns
TRUE if a value was entered and the dialog closed with 'OK'. FALSE otherwise.
Since
0.16

◆ dialogs_show_msgbox()

void dialogs_show_msgbox ( GtkMessageType  type,
const gchar *  text,
  ... 
)

Shows a message box of the type type with text.

Parameters
typeA GtkMessageType, e.g. GTK_MESSAGE_INFO, GTK_MESSAGE_WARNING, GTK_MESSAGE_QUESTION, GTK_MESSAGE_ERROR.
textPrintf()-style format string.
...Arguments for the text format string.

◆ dialogs_show_question()

gboolean dialogs_show_question ( const gchar *  text,
  ... 
)

Shows a question message box with text and Yes/No buttons.

Parameters
textPrintf()-style format string.
...Arguments for the text format string.
Returns
TRUE if the user answered with Yes, otherwise FALSE.

◆ dialogs_show_save_as()

gboolean dialogs_show_save_as ( void  )

Shows the Save As dialog for the current notebook page.

Returns
TRUE if the file was saved, otherwise FALSE.