Top | ![]() |
![]() |
![]() |
![]() |
void | gwy_app_switch_tool () |
const gchar * | gwy_app_current_tool_name () |
GwyTool * | gwy_app_current_tool () |
void | gwy_app_add_main_accel_group () |
void | gwy_app_save_window_position () |
void | gwy_app_restore_window_position () |
GtkWidget * | gwy_app_main_window_get () |
void | gwy_app_main_window_set () |
void | gwy_app_data_view_change_mask_color () |
gboolean | gwy_app_quit () |
void
gwy_app_switch_tool (const gchar *toolname
);
Switches the current tool to given tool.
If the tool is already active it is shown when hidden and hidden when visible.
const gchar *
gwy_app_current_tool_name (void
);
Obtains the name of currently active tool.
See gwy_app_switch_tool()
for the name description.
In some rare circumstances, this function can return NULL
because no tool is active. This includes program
startup and shutdown and during the construction of a new GwyTool object while switching tools. Also, NULL
is
typically returned outside Gwyddion in programs just using the libraries.
GwyTool *
gwy_app_current_tool (void
);
Obtains the currently active tool object.
In some rare circumstances, this function can return NULL
because no tool is active. This includes program
startup and shutdown and during the construction of a new GwyTool object while switching tools. Also, NULL
is
typically returned outside Gwyddion in programs just using the libraries.
void
gwy_app_add_main_accel_group (GtkWindow *window
);
Adds main (global) application accelerator group to a window.
This includes accelerators for terminating Gwyddion, opening files, etc.
void gwy_app_save_window_position (GtkWindow *window
,const gchar *prefix
,gboolean position
,gboolean size
);
Saves position and/or size of a window to settings.
Some sanity checks are included, therefore if window position and/or size is too suspicious, it is not saved.
void gwy_app_restore_window_position (GtkWindow *window
,const gchar *prefix
,gboolean grow_only
);
Restores a window position and/or size from settings.
Unlike gwy_app_save_window_position()
, this function has no position
and size
arguments, it simply restores all
attributes that were saved.
Note to restore position (not size) it should be called twice for each window to accommodate sloppy window managers: once before the window is shown, second time immediately after showing the window.
Some sanity checks are included, therefore if saved window position and/or size is too suspicious, it is not restored.
window |
A window to restore position of. |
|
prefix |
Unique prefix in settings to get the information from (the same as
in |
|
grow_only |
|
GtkWidget *
gwy_app_main_window_get (void
);
Returns Gwyddion main application window (toolbox).
void
gwy_app_main_window_set (GtkWidget *window
);
Sets the main application window.
This function is probably only useful in Gwyddion itself and should be ignored.
It needs to be called exactly once at Gwyddion startup. It restores the toolbox position and makes
gwy_app_main_window_get()
work.
void
gwy_app_data_view_change_mask_color (GwyDataView *data_view
);
Runs mask color selector on a data view.
This is a convenience function to run gwy_color_selector_for_mask()
, possibly taking the initial color from
settings.
gboolean
gwy_app_quit (void
);
Quits the application.
This function may present a confirmation dialog to the user and it may let the application to continue running. If
it quits the application, it performs some shutdown actions and then quits the Gtk+ main loop with gtk_main_quit()
.