1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gtk/gtk.h>
#include "main.h"
#include "callbacks.h"
#include "interface.h"
#include "support.h"
#include "gtkmeter.h"
#include "gtkmeterscale.h"
#include "threads.h"
static int button_pressed = 0;
void on_togglebutton1_clicked(GtkButton * button, gpointer user_data)
{
GtkWidget *img = lookup_widget(main_window, "toggle_image");
if (!GTK_WIDGET_IS_SENSITIVE(img)) {
return;
}
button_pressed = !button_pressed;
if (button_pressed) {
recording_start();
gtk_image_set_from_pixbuf(GTK_IMAGE(img), img_on);
gtk_window_set_icon(GTK_WINDOW(main_window), icon_on);
} else {
recording_stop();
gtk_widget_set_sensitive(img, FALSE);
gtk_image_set_from_pixbuf(GTK_IMAGE(img), img_busy);
gtk_window_set_icon(GTK_WINDOW(main_window), icon_off);
}
}
gboolean on_window_delete_event(GtkWidget * widget, GdkEvent * event,
gpointer user_data)
{
gtk_main_quit();
return FALSE;
}
|