Pass text to a browser...
- From: Eric Rodriguez <eric-r-rodriguez austin rr com>
- To: gtk-app-devel-list gnome org
- Subject: Pass text to a browser...
- Date: Wed, 15 Mar 2006 03:51:52 -0600
Here is my issue:
I am creating a very simple app that consists of a text field and a
submit button. My goal is to add text to the text field and when the
submit button is hit, it will pass a url to a browser.
For instance:
When "123" is entered into the text field and the "submit" button is
hit, it will open a browser to http://website.com/path=123
By scouring the web for info, I've been able to combine the text and
have it print at the top of the app...here's the code:
void
on_button1_clicked(GtkButton *button, gpointer user_data){
GtkWidget * label = lookup_widget(GTK_WIDGET(button), "label1");
GtkWidget * entry = lookup_widget(GTK_WIDGET(button), "entry1");
gchar output[50]="http://website.com/path=";
strcat(output,gtk_entry_get_text(GTK_ENTRY(entry)));
gtk_label_set_text(GTK_LABEL(label),output);
}
This was pretty much done for testing purposes...
Obviously, instead of having the url print on the top of the app, I'd
like the url to be passed to a browser when the submit button is hit.
The operating system is linux, and the browser will either be firefox or
konqueror.
Here is the little I have so far...
#ifdef __linux__
#define BROWSER "konqueror"
#else
#define BROWSER "firefox"
#endif
I'm sure that will define the browser, I'm just not sure how to pass the
url to said browser.
Thanks in advance!
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]