From Olof.Frahm at web.de Tue Sep 9 01:59:07 2008 From: Olof.Frahm at web.de (Olof-Joachim Frahm) Date: Tue, 9 Sep 2008 03:59:07 +0200 Subject: [cells-gtk-devel] simple example / beginner Message-ID: <20080909015907.GA21102@localhost> Hello, using the patch to the current cffi (1.10.1) version I managed to run cells-gtk (cvs version). Now what I don't get, since the test-gtk example won't run, is, how this small example: (defmodel gtk-browser (gtk-app) () (:default-initargs :title "GTK Cells Example" :kids (list (mk-label :text "Foo!")))) can be modified so that it's valid. At the moment this leads to "New as of Cells3: parent must be supplied to make-instance LABEL ..." Exchanging the :kids line with (c? (list (mk-label :text "Foo!" :fm-parent self))) works. So my question is, what did I get wrong :) or better, how can I specify the model without having a c? in front, since (this part of the) UI is static and not computed by a formula. Thanks for all anwsers, Olof -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: From kennytilton at optonline.net Tue Sep 9 02:44:09 2008 From: kennytilton at optonline.net (Kenny Tilton) Date: Mon, 08 Sep 2008 22:44:09 -0400 Subject: [cells-gtk-devel] simple example / beginner In-Reply-To: <20080909015907.GA21102@localhost> References: <20080909015907.GA21102@localhost> Message-ID: <48C5E2F9.4050304@optonline.net> Olof-Joachim Frahm wrote: > Hello, > using the patch to the current cffi (1.10.1) version I managed to run > cells-gtk (cvs version). > Now what I don't get, since the test-gtk example won't run, is, how this > small example: > > (defmodel gtk-browser (gtk-app) > () > (:default-initargs > :title "GTK Cells Example" > :kids (list (mk-label :text "Foo!")))) > > can be modified so that it's valid. At the moment this leads to > "New as of Cells3: parent must be supplied to make-instance LABEL ..." > > Exchanging the :kids line with > > (c? (list (mk-label :text "Foo!" :fm-parent self))) > > works. So my question is, what did I get wrong :) Nothing. > or better, how can I > specify the model without having a c? in front, since (this part of the) > UI is static and not computed by a formula. Formulas for initforms/initargs are cool not just when things change over time but /also/ because they make the instance being initialized visible to the initializing form, so in that sense the c? is not superfluous, it is just performing one of its less heroic roles. There will not be much performance penalty, btw, becasue the rule gets optimized away if indeed there are no dependencies. To totally avoid the rule, well, I actually forget how that requirement came about. You oculd always turn off the assertion, setf the parent in the kids observer, and see what happens. Me, I just toss in the (c?...) and get on with the app. kt -- http://www.theoryyalgebra.com/ From Olof.Frahm at web.de Tue Sep 9 06:22:49 2008 From: Olof.Frahm at web.de (Olof-Joachim Frahm) Date: Tue, 9 Sep 2008 08:22:49 +0200 Subject: [cells-gtk-devel] simple example / beginner In-Reply-To: <48C5E2F9.4050304@optonline.net> References: <20080909015907.GA21102@localhost> <48C5E2F9.4050304@optonline.net> Message-ID: <20080909062249.GA21815@localhost> Wow, thanks for the fast anwser. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: From kennytilton at optonline.net Mon Sep 15 11:12:18 2008 From: kennytilton at optonline.net (Kenny Tilton) Date: Mon, 15 Sep 2008 07:12:18 -0400 Subject: [cells-gtk-devel] Re: cello clue pls In-Reply-To: <20080915105811.96417A6D23@moon.robolove.meer.net> References: <20080908.175859.230115660.enometh@meer.net> <48C51E01.6030708@optonline.net> <20080915105811.96417A6D23@moon.robolove.meer.net> Message-ID: <48CE4312.6080507@optonline.net> Madhu wrote: > |Date: Mon, 08 Sep 2008 08:43:45 -0400 > |From: Kenny Tilton > | > |Thru ix-togl. From my current app, edited down somewhat: > | > |(defmd algebra-one-window (sound-manager cello-window) > > Would you expect this to work? > > (defmd helu-window (cello-window) > :title$ "Helu World" > :kids (c? (the-kids > (make-kid 'ix-togl > :registry? t > :px 0 :py 0 > :ll 0 :lt 0 > :lr (c-in (scr2log 600)) > :lb (c-in (scr2log -400)) > :kids (c? (the-kids > (make-kid 'ix-zero-tl > :md-name :geo-tl > :px 0 :py 0 > :kids (c? (the-kids > (make-kid 'ix-text > :pre-layer (with-layers (:rgba +white+)) > :md-name :helu-t1 > :text-font (font-ftgl-ensure :texture > '#:|luxisr| 10) > :text$ (c-in "Hello World"))))))))))) > > > (trace ix-render-in-font togl-create-using-class) > (gears::gears) ;; and close gears window. this initializes ftgl-ogl: else > ;; ftgl-ogl is used before create-togl-using-class gets > ;; called when instantiating `helu-window' > (progn (kt-opengl-reset) (cl-ftgl-reset) (cl-ftgl-init) (wands-clear)) > > (test-window 'helu-window) > > What could be the reason the ix-text widget does not get rendered? > I'm sure I'm missing something really basic. A few things to look at (I'll try myself if I get a free moment, but I am on deadline): 1. Most likely you are painting white on white. Try: (with-layers +white+ :fill +black+) ...which makes sure you get a white background and then leaves the rendering color black for when the text gets rendered. 2. I forget, do widgets have default px and py of zero? You do not see much px and py in my code because I find I layout everything as a tree of rows and stacks where px/py get auto-supplied by a cute kid-slotting trick. The container here is ix-zero-tl, meaning it just knows it has a topleft of zero-zero and kids can put themselves anywhere, so it does not provide px/py for kids like rows and cols do. I am pretty sure you would backtrace if there were a problem here, but px/py of 10,-10 won't hurt. 3. Is that font being found? Again, I think the code backtraces if it is unhappy about that, but it is something I would check. cheers, ken -- http://www.theoryyalgebra.com/