Re: Pass text to a browser...
- From: Iago Rubio <iago iagorubio com>
- To: gtk-app-devel-list gnome org
- Subject: Re: Pass text to a browser...
- Date: Wed, 15 Mar 2006 17:28:07 +0100
On Wed, 2006-03-15 at 13:36 +0100, Iago Rubio wrote:
void
on_button1_clicked(GtkButton *button, gpointer user_data)
{
gchar *output;
GError *error = NULL;
GtkWidget *label = lookup_widget(GTK_WIDGET(button), "label1");
GtkWidget *entry = lookup_widget(GTK_WIDGET(button), "entry1");
const gchar *url = "http://website.com/path";
if( entry ){
output = g_strdup_printf("%s %s=%s",
BROWSER,
url,
gtk_entry_get_text(GTK_ENTRY(entry))
);
g_spawn_command_line_async (output, &error);
if( error ){
g_print( "Error: %s\n", error->message );
g_error_free(error);
}
// Sorry for the leak, "output" should be freed
g_free( output );
}
}
--
Iago Rubio
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]