|
|
| Author |
Message |
|
|
iswariak Familiar Face
Joined: 28 Jun 2006 Posts: 8
|
Posted: Wed Jun 28, 2006 5:13 am Post subject: How to display an html page in gtk |
|
|
Hi all
I am a novice programmer in GTK.
Can anyone tell how to display an html page in GTK. I have tried GTKHtml and there few dependancy issues.
Any suggestions will help me.
Iswaria. |
|
| Back to top |
|
 |
iswariak Familiar Face
Joined: 28 Jun 2006 Posts: 8
|
Posted: Thu Jun 29, 2006 6:01 am Post subject: Launch browser window when selecting list box entry. |
|
|
Hi
Now I am able to launch browser window when I click the GNOME href new button. But I want to launch the browser when I select something in the GTK list box.
Code for GNOME href button
----------------------------------------------------------------------------------------------------------
#include <gnome.h>
GtkWidget * href1, *fixed1;
href1 = gnome_href_new ("http://www.ifpindia.org/", _("Visit IFP"));
gtk_widget_show (href1);
gtk_fixed_put (GTK_FIXED (fixed1), href1, 56, 152);
gtk_widget_set_size_request (href1, 216, 32);
-------------------------------------------------------------------------------------------------------
Suggestions will be very helpful.
Thanks
Iswaria. |
|
| Back to top |
|
 |
iswariak Familiar Face
Joined: 28 Jun 2006 Posts: 8
|
Posted: Fri Jun 30, 2006 5:46 am Post subject: Gtkmozembed widget |
|
|
Hi all
Gtkmozembed widget helps to embed browser in GTK.
Have anyone worked with gtkmozembed widget?
If so, please give the sample code.
Thanks
Iswaria. |
|
| Back to top |
|
 |
Micah Carrick Never Seen the Sunlight
Joined: 21 Sep 2005 Posts: 497 Location: Portland, OR USA
|
|
| Back to top |
|
 |
iswariak Familiar Face
Joined: 28 Jun 2006 Posts: 8
|
Posted: Tue Jul 04, 2006 6:30 am Post subject: |
|
|
Hi
when I use the following code it is working fine.
Code for GNOME href button
----------------------------------------------------------------------------------------------------------
#include <gnome.h>
GtkWidget * href1, *fixed1;
href1 = gnome_href_new ("http://www.ifpindia.org/", _("Visit IFP"));
gtk_widget_show (href1);
gtk_fixed_put (GTK_FIXED (fixed1), href1, 56, 152);
gtk_widget_set_size_request (href1, 216, 32);
----------------------------------------------------------------------------------------------------------
When I change the website address to local address "file:///home/OscarDesktop/Images/especes/b/brare/brare.html" the following error occurs:
An error has occurred while trying to launch the default web browser.
Please check your settings in the 'Preferred Applications' preference
tool.
Please suggest.
Thanks
Iswaria. |
|
| Back to top |
|
 |
Micah Carrick Never Seen the Sunlight
Joined: 21 Sep 2005 Posts: 497 Location: Portland, OR USA
|
Posted: Tue Jul 04, 2006 3:16 pm Post subject: |
|
|
| It looks as though it's not using the file:/// to mean web browser. Perhaps you can use a call to something like system("firefox file:///blablabla") or perhaps there is a way to get the default web browser and then call it using system or one of the exec functions? |
|
| Back to top |
|
 |
Micah Carrick Never Seen the Sunlight
Joined: 21 Sep 2005 Posts: 497 Location: Portland, OR USA
|
|
| Back to top |
|
 |
iswariak Familiar Face
Joined: 28 Jun 2006 Posts: 8
|
|
| Back to top |
|
 |
Micah Carrick Never Seen the Sunlight
Joined: 21 Sep 2005 Posts: 497 Location: Portland, OR USA
|
Posted: Wed Jul 05, 2006 5:11 pm Post subject: |
|
|
| Great... the only problem is that your users will have to have firefox in order for that to work. But if you're just using it for yourself... that'll work just fine. |
|
| Back to top |
|
 |
iswariak Familiar Face
Joined: 28 Jun 2006 Posts: 8
|
Posted: Thu Jul 06, 2006 5:16 am Post subject: System command and browser |
|
|
Hi
Is it possible to say the default browser in the user computer instead of specifying firefox? We can't assume all the users will have firefox.
Thanks
Iswaria. |
|
| Back to top |
|
 |
Micah Carrick Never Seen the Sunlight
Joined: 21 Sep 2005 Posts: 497 Location: Portland, OR USA
|
Posted: Thu Jul 06, 2006 5:23 am Post subject: |
|
|
| If it's a gnome application, then you can use GConf to determine which is application "handles" firefox. I don't know how it would work with KDE or other environments. You may also want to have a preferences dialog in you application in which the user specifies their browser... or programatically check for several of the more well known browsers. |
|
| Back to top |
|
 |
|