Skip to content

Commit

Permalink
ManualPicker: automatically save when closing the window
Browse files Browse the repository at this point in the history
  • Loading branch information
biochem-fan committed Nov 10, 2023
1 parent 93049a2 commit dd7d056
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/manualpicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ int manualpickerGuiWindow::fill()
{
color(GUI_BACKGROUND_COLOR);

this->callback(cb_closing);

Fl_Menu_Bar *menubar = new Fl_Menu_Bar(0, 0, w(), 25);
if (do_allow_save)
Expand Down Expand Up @@ -580,15 +581,22 @@ void manualpickerGuiWindow::cb_menubar_quit(Fl_Widget* w, void* v)

void manualpickerGuiWindow::cb_menubar_quit_i()
{
cb_menubar_save_i();
cb_menubar_recount_i();
exit(0);
}

void manualpickerGuiWindow::cb_closing(Fl_Widget* w, void* v)
{
manualpickerGuiWindow* T=(manualpickerGuiWindow*)w;
T->cb_menubar_quit_i();
}

void manualpickerGuiWindow::cb_menubar_recount(Fl_Widget* w, void* v)
{
manualpickerGuiWindow* T=(manualpickerGuiWindow*)v;
T->cb_menubar_recount_i();
}

void manualpickerGuiWindow::cb_menubar_recount_i()
{

Expand Down Expand Up @@ -781,10 +789,6 @@ void ManualPicker::initialise()
global_lowpass = new_nyquist;
std::cout << " Set low-pass filter to " << global_lowpass << " due to downscaling of " << global_micscale << std::endl;
}

std::cerr << " NOTE: in order to write the new list of coordinate STAR files, you need to re-count the particles or quite this program through the File menu. Do NOT kill the program using the operating system's window manager!" << std::endl;


}

void ManualPicker::run()
Expand Down
2 changes: 2 additions & 0 deletions src/manualpicker.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ class manualpickerGuiWindow : public Fl_Window
static void cb_menubar_quit(Fl_Widget*, void*);
inline void cb_menubar_quit_i();

static void cb_closing(Fl_Widget*, void*);

static void cb_menubar_recount(Fl_Widget*, void*);
inline void cb_menubar_recount_i();

Expand Down

0 comments on commit dd7d056

Please sign in to comment.