Thread: [Lisp-cffi-qt4-list] text-browser's anchor-clicked signal
Status: Inactive
Brought to you by:
solopsil
From: Radoslav A. <rsd...@gm...> - 2006-10-22 21:25:52
|
Hi, all. At first, thanks to the author of the project - it's something I was waiting to find :) I'm just playing with 0.2g, and it worked fine with some simple things I tried. The first toy I have in mind is to build a simple browser for some preformatted text, so I tried the following: > (require :qt "qt") > > (defpackage qt-user (:use cl qt)) > (in-package qt-user) > > (defun a-clicked (&rest args)) > > (with-qt () > (object html 'text-browser) ; 'text-edit) > (setpr html :html "<font color='red'>Hello, <a > href='http://dir.bg'>Bulgaria</a>!</font>") > (connect html 'anchor-clicked #'a-clicked)) ;(lambda (&rest args) > (print (getpr (sender) :html))))) ; (lambda () (message-box :info > (format nil "~A" url))))) And then: > D:\Opt\Lisp\qt\examples-0.2g>ecl -shell test.lisp > ;;; Loading #P"D:/Opt/Lisp/qt/examples-0.2g/qt.lisp" > ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/cffi.fas" > ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/utils.fas" > ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/features.fas" > ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/cffi-ecl.fas" > ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/package.fas" > ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/libraries.fas" > ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/early-types.fas" > ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/types.fas" > ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/enum.fas" > ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/strings.fas" > ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/functions.fas" > ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/foreign-vars.fas" > An error occurred during initialization: > Segmentation violation.. > > D:\Opt\Lisp\qt\examples-0.2g> I tried with (lamda () ...), #'(lambda () ...), (lambda (&rest) ...), #'(lambda (&rest) ...) and then with defun-ed function... - getting each time "Segmentation fault". Any ideas? Greetings, Rado P.S. I see that the mailing list is not used much, but I had no other idea how to contact the admin/team, as the "Admin" tab is restricted. I'm also a SF project administrator, of a small, almost dead, C++/QT project (http://sourceforge.net/projects/bgbible), I would like to renew some day, maybe in Lisp. So as a first step, maybe I can help with something to lisp-cffi-qt4... |
From: Radoslav A. <rsd...@gm...> - 2006-10-22 21:42:07
|
If I remove the "connect" form it works just fine. If I connect another signal (e.g. text-changed), it also works. I also tried with "text-edit" instead of "text-browser" - the effect was the same. For me that's a hint, that the problem is in "anchor-clicked" signal's implementation. Radoslav Atanasov wrote: > Hi, all. > > At first, thanks to the author of the project - it's something I was > waiting to find :) > > I'm just playing with 0.2g, and it worked fine with some simple things > I tried. The first toy I have in mind is to build a simple browser for > some preformatted text, so I tried the following: > >> (require :qt "qt") >> >> (defpackage qt-user (:use cl qt)) >> (in-package qt-user) >> >> (defun a-clicked (&rest args)) >> (with-qt () >> (object html 'text-browser) ; 'text-edit) >> (setpr html :html "<font color='red'>Hello, <a >> href='http://dir.bg'>Bulgaria</a>!</font>") >> (connect html 'anchor-clicked #'a-clicked)) ;(lambda (&rest args) >> (print (getpr (sender) :html))))) ; (lambda () (message-box :info >> (format nil "~A" url))))) > And then: > >> D:\Opt\Lisp\qt\examples-0.2g>ecl -shell test.lisp >> ;;; Loading #P"D:/Opt/Lisp/qt/examples-0.2g/qt.lisp" >> ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/cffi.fas" >> ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/utils.fas" >> ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/features.fas" >> ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/cffi-ecl.fas" >> ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/package.fas" >> ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/libraries.fas" >> ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/early-types.fas" >> ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/types.fas" >> ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/enum.fas" >> ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/strings.fas" >> ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/functions.fas" >> ;;; Loading "D:/Opt/Lisp/qt/examples-0.2g/cffi/foreign-vars.fas" >> An error occurred during initialization: >> Segmentation violation.. >> >> D:\Opt\Lisp\qt\examples-0.2g> > I tried with (lamda () ...), #'(lambda () ...), (lambda (&rest) ...), > #'(lambda (&rest) ...) and then with defun-ed function... - getting > each time "Segmentation fault". > > Any ideas? > > Greetings, > Rado > > P.S. I see that the mailing list is not used much, but I had no other > idea how to contact the admin/team, as the "Admin" tab is restricted. > I'm also a SF project administrator, of a small, almost dead, C++/QT > project (http://sourceforge.net/projects/bgbible), I would like to > renew some day, maybe in Lisp. So as a first step, maybe I can help > with something to lisp-cffi-qt4... > |
From: Radoslav A. <rsd...@gm...> - 2006-10-23 11:49:04
|
Hi, Paul. Thank you so much for the quick and relevant response :) I'm looking forward the new version, to continue my toy-thing, and give you more feedback ;) Regards, Rado myteam - Paul wrote: > Hi, > > Radoslav Atanasov wrote: >> [...] that the problem is in "anchor-clicked" signal's implementation. > > the problem is the "url" data type; I just added the QUrl data type in > the callback code in cqt.h and cqt.cpp, and now it works. > > I will release an updated version within a day or so, then you can try > by yourself. > >> P.S. I see that the mailing list is not used much, but I had no other >> idea how to contact the admin/team, as the "Admin" tab is restricted. >> I'm also a SF project administrator, of a small, almost dead, C++/QT >> project (http://sourceforge.net/projects/bgbible), I would like to >> renew some day, maybe in Lisp. So as a first step, maybe I can help >> with something to lisp-cffi-qt4... > > You can reach me directly at <paul AT myteam-software DOT com> (I'm > the author of this project). > > Currently the best way to help the project would be to use it for some > small apps, and to give as much feedback as possible! > (As you already did with the above "url" problem, thanks BTW!). > > Paul > > |