Re: [pygtk] How can I create hyperlink on a Dialog Box
On Fri, 29 Apr 2005 05:28:23 -0700 (PDT) Mahmad Sadique Hannure <[EMAIL PROTECTED]> wrote: > I am working on a module called Report Bugs which > requires a hyperlink which open our web site in > default browser. I am able to implement effect looks > like a hyperlink by using Pango Markup language > as like > > > label.set_text(" underline=\"single\">" +[PROTECTED WEB SITE] + > ") > label.set_use_markup(True) > > So if any one knows the solution please help me Well, you put the label inside a button. Gnome btw. has a widget (GnomeHRef) for this precise purpose. But since I don't want my app depend on Gnome, I have created my own version, which was easy enough. It starts like that: def href_button(box, caption): hbox = gtk.HBox(False) ; box.pack_start(hbox, True, True, 0) label = gtk.Label(""+caption+':'+'') label.set_use_markup(True) button = gtk.Button() button.add(label) button.set_relief(gtk.RELIEF_NONE) ... How do you plan to get the default browser? If you read the Gnome GConf key, be aware that you are excluding all non-Gnome users, which usually won't bother with Gnome's Control Center. You *can* use the Gnome preferred apps key, but it is a good idea to make the browser choice configurable from inside your app as well. The kind of "integration" which the "Preferred Applications" capplet provides is misguided and a disservice to FOSS users at large lest it happens in a freedesktop.org context. ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] How can I create hyperlink on a Dialog Box
On Fri, 2005-29-04 at 05:28 -0700, Mahmad Sadique Hannure wrote: > I am working on a module called Report Bugs which > requires a hyperlink which open our web site in > default browser. I am able to implement effect looks > like a hyperlink by using Pango Markup language > as like > > > label.set_text(" underline=\"single\">" +[PROTECTED WEB SITE] + > ") > label.set_use_markup(True) > > So if any one knows the solution please help me > > Thaank You > > __ I don't know if this will work in a dialog box the same, but here is how we do it in a TextBuffer. It should be very similar. http://cvs.sourceforge.net/viewcvs.py/porthole/porthole/summary.py?view=markup Hope this helps. -- Brian <[EMAIL PROTECTED]> ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
[pygtk] How can I create hyperlink on a Dialog Box
I am working on a module called Report Bugs which requires a hyperlink which open our web site in default browser. I am able to implement effect looks like a hyperlink by using Pango Markup language as like label.set_text("" +[PROTECTED WEB SITE] + ") label.set_use_markup(True) So if any one knows the solution please help me Thaank You __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/