Re: Open a url in webbrowser ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2009-04-17 at 03:51 -0700, parthiv wrote:
> Thanks for the solution........eagerly searching for it... finally it
> worked ............ GError *error = NULL; GdkScreen *gscreen=NULL;
> gtk_show_uri(&gscreen,"http://google.com",10,&error); 

that's utterly wrong. you should read the documentation on
library.gnome.org instead of using random stuff as arguments.

the correct call is:

  GError *error;

  error = NULL;
  gtk_show_uri (gdk_screen_get_default (),
                "http://google.com";,
                gtk_get_current_event_time (),
                &error);

but it's better to have a GtkWidget to get the correct screen and the
event time:

  GdkScreen *screen;
  GError *error;

  if (gtk_widget_has_screen (widget))
    screen = gtk_widget_get_screen (widget);
  else
    screen = gdk_screen_get_default ();

  error = NULL;
  gtk_show_uri (screen, "http://google.com";,
                gtk_get_current_event_time (),
                &error);

ciao,
 Emmanuele.

-- 
Emmanuele Bassi,
W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux