Re: [Vala] about dialog: website not clickable



Dr. Michael J. Chudobiak wrote:
Hi all,

I have some fairly routine vala code to show an About dialog, including
a website link. The website is supposed to be clickable, but when the
program runs the link is not actually clickable. Am I missing something?
How do I get a clickable website link?

Hi,

you must set a URL hook:

    Gtk.AboutDialog.set_url_hook (url_hook);
    Gtk.show_about_dialog (...);


  private void url_hook (Gtk.AboutDialog about, string link) {
      try {
          Gtk.show_uri (null, link, Gdk.CURRENT_TIME);
      } catch (Error e) {
          stderr.printf ("Error: %s", e.message);
      }
  }


Regards,

Frederik



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