summaryrefslogtreecommitdiffstats
path: root/globals.c
blob: cbe58979fa4b6869a7b9bed5a5a97712ad844213 (plain)
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
#include <gtk/gtk.h>

#include "globals.h"


void set_parameter_text (GtkWidget *entry, gchar **param)
{
    gchar *tmp;

    tmp = g_strdup(gtk_entry_get_text (GTK_ENTRY(entry)));

    g_strstrip(tmp);

    g_free(*param);
    *param = g_strdup(tmp);

    g_free(tmp);
}

/**
*   Boolean value in given parameter
*/
void set_parameter_bool (GtkWidget *checkbox, gboolean *param)
{
    *param = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox));
}