GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Apr 18, 2014 8:03 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: GtkAboutDdialog - Could not show link message
PostPosted: Wed Nov 16, 2011 9:40 am 
Offline
Familiar Face

Joined: Fri Mar 25, 2011 7:55 am
Posts: 35
Location: romania
Hi,

I have this code:
Code:
#include <gtk/gtk.h>
void about_dialog( GtkWidget *widget,
                   gpointer   data ) {

   GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file( "test.png", NULL );

   GtkWidget *dialog = gtk_about_dialog_new();
   gtk_about_dialog_set_name( GTK_ABOUT_DIALOG( dialog ), "program" );
   gtk_about_dialog_set_version( GTK_ABOUT_DIALOG( dialog ), "0.0.0" );
   gtk_about_dialog_set_copyright( GTK_ABOUT_DIALOG( dialog ), "autor" );
   gtk_about_dialog_set_comments( GTK_ABOUT_DIALOG( dialog ), "comment" );
   gtk_about_dialog_set_website_label( GTK_ABOUT_DIALOG( dialog ), "myWebSite");
   gtk_about_dialog_set_website( GTK_ABOUT_DIALOG( dialog ), "http://www.gtk.org/" );
   gtk_about_dialog_set_logo(GTK_ABOUT_DIALOG(dialog), pixbuf );
   g_object_unref( pixbuf );
   gtk_dialog_run( GTK_DIALOG( dialog ));
   gtk_widget_destroy( dialog );
}
int main( int argc, char *argv[]) {

   GtkWidget *window;
   GtkWidget *main_vbox;
   GtkWidget *about;

   gtk_init(&argc, &argv);

   window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
   gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
   gtk_window_set_default_size(GTK_WINDOW(window), 220, 150);
   gtk_window_set_title( GTK_WINDOW( window ), "About dialog");
   g_signal_connect( G_OBJECT( window ), "delete-event", G_CALLBACK( gtk_main_quit ), NULL );

   main_vbox = gtk_vbox_new( FALSE, 1 );
   gtk_container_set_border_width( GTK_CONTAINER( main_vbox ), 1 );
   gtk_container_add( GTK_CONTAINER( window ), main_vbox );

   about = gtk_button_new_with_label( "About" );
   gtk_box_pack_start( GTK_BOX( main_vbox ), about, TRUE, FALSE, 0 );
   g_signal_connect( G_OBJECT( about ), "clicked", G_CALLBACK( about_dialog ), NULL );
 
   gtk_widget_show_all(window);
   gtk_main();
   return 0;
}


when i click the link for myWebSite i get a error dialog:
Could not show link
No application is registered as handling this file.

What is wrong ?

Thanks

_________________
c/c++ for ever


Top
 Profile  
 
 Post subject: Re: GtkAboutDdialog - Could not show link message
PostPosted: Fri Nov 18, 2011 9:47 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 709
Location: UK
Hi,

The application ran OK on my system and clicking on the link worked for me. Maybe it is just a setting on your computer? Note that gtk_about_dialog_set_name() has been deprecated since version 2.12 and you should now be using gtk_about_dialog_set_program_name() instead.

E.

_________________
E.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group