[cells-gtk-devel] Re: cello clue pls

Kenny Tilton kennytilton at optonline.net
Mon Sep 15 11:12:18 UTC 2008


Madhu wrote:
>   |Date: Mon, 08 Sep 2008 08:43:45 -0400
>   |From: Kenny Tilton <kennytilton at optonline.net>
>   |
>   |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/



More information about the cells-gtk-devel mailing list