The dialogs
module¶
This module contains some help functions to show file-related dialogs,
miscellaneous dialogs, etc. You can of course just use the gtk
module
to create your own dialogs as well.
-
dialogs.
show_input
([title=None[, parent=None[, label_text=None[, default_text=None]]]])¶ Shows a
gtk.Dialog
to ask the user for text input.Parameters: - title – The window title for the dialog.
- parent – The parent
gtk.Window
for the dialog, for examplegeany.main_widgets.window
. - label_text – Text to put in the label just about the input entry box.
- default_text – Default text to put in the input entry box.
Returns: A string containing the text the user entered.
-
dialogs.
show_input_numeric
([title=None[, label_text=None[, value=0.0[, minimum=0.0[, maximum=100.0[, step=1.0]]]]]])¶ Shows a
gtk.Dialog
to ask the user to enter a numeric value using agtk.SpinButton
.Parameters: - title – The window title for the dialog.
- label_text – Text to put in the label just about the numeric entry box.
- value – The initial value in the numeric entry box.
- minimum – The minimum allowed value that can be entered.
- maximum – The maximum allowed value that can be entered.
- step – Amount to increment the numeric entry when it’s value is moved up or down (ex, using arrows).
Returns: The value entered if the dialog was closed with ok, or
None
if it was cancelled.
-
dialogs.
show_msgbox
(text[, msgtype=gtk.MESSAGE_INFO])¶ Shows a
gtk.Dialog
to show the user a message.Parameters: - text – The text to show in the message box.
- msgtype – The message type which is one of the Gtk Message Type Constants.
-
dialogs.
show_question
(text)¶ Shows a
gtk.Dialog
to ask the user a Yes/No question.Parameters: text – The text to show in the question dialog. Returns: True
if the Yes button was pressed,False
if the No button was pressed.
-
dialogs.
show_save_as
()¶ Shows Geany’s Save As dialog.
Returns: True
if the file was saved,False
otherwise.