Hi,
I made a notebook widget for celtk. It just uses the built-in tile notebook and introduces a "tab" widget which is just a container for stuff you can add to a notebook.
On a separate note, I was having trouble getting the latest versions of cells and celtk to play nicely together. I reverted back to cells from March to work on this stuff since that's when I was last working on my expander widget. I'll investigate the problems and try to provide some more useful input later this week.
;--- n o t e b o o k ----------------------------------------------
(deftk notebook (widget decoration-mixin) () (:tk-spec notebook -height -padding -width) (:default-initargs :id (gentemp "NB") :packing nil))
(defmethod make-tk-instance ((self notebook)) (tk-format `(:make-tk ,self) "ttk::notebook ~a" (^path)) (tk-format `(:pack ,self) "pack ~a -expand yes -fill both" (^path)))
(defobserver .kids ((self notebook)) (loop for k in (^kids) do (trc "ttk::notebook adds" k (type-of k) (md-name k) (path k)) (tk-format `(:post-make-tk ,self) "~a add ~a -text ~a" (^path) (path k) (text k))))
;--- t a b -----------------------------------------------------------
(deftk tab (frame-stack widget) () (:tk-spec tab -state -sticky -padding -text -image) (:default-initargs :id (gentemp "TB")))
(defmacro mk-tab ((&rest inits) &body body) `(make-instance 'tab :fm-parent *parent* ,@inits :kids (c? (the-kids ,@body))))
(defmethod make-tk-instance ((self tab)) (tk-format `(:make-tk ,self) "frame ~a" (^path)))
;--- example usage ---------------------------------------------------
(defmd nb-test (window) (kids (c? (the-kids (mk-notebook :width 100 :kids (c? (the-kids (mk-tab (:text "first") (mk-stack ("tab with container") (mk-label :text "hi"))) (mk-tab (:text "second") (mk-label :text "a") (mk-label :text "b")))))))))
(defun test-nb () (test-window 'nb-test))
Andy Chambers wrote:
Hi,
I made a notebook widget for celtk. It just uses the built-in tile notebook and introduces a "tab" widget which is just a container for stuff you can add to a notebook.
Cool. I'll try to get it into CVS later.
On a separate note, I was having trouble getting the latest versions of cells and celtk to play nicely together. I reverted back to cells from March to work on this stuff since that's when I was last working on my expander widget. I'll investigate the problems and try to provide some more useful input later this week.
This rings a bell. I tripped up Peter with a change that tightened things up. Peter, do you remember what that was? I think it was the change distinguishing the list of "askers" and the idea of the dependent Cell, such that ask cycles got detected even where one had used without-c-dependency (perhaps by calling fm-other).
kt
On a separate note, I was having trouble getting the latest versions of cells and celtk to play nicely together. I reverted back to cells from March to work on this stuff since that's when I was last working on my expander widget. I'll investigate the problems and try to provide some more useful input later this week.
This rings a bell. I tripped up Peter with a change that tightened things up. Peter, do you remember what that was? I think it was the change distinguishing the list of "askers" and the idea of the dependent Cell, such that ask cycles got detected even where one had used without-c-dependency (perhaps by calling fm-other).
Yep, I remember there was something like that, but IIRC you modified the cycle-detection code in cells to address this issue.
Off the top of my head (Disclaimer: I might mix things up here), Ken identified some recently introduced constrained in cells which collided with the way menus were instantiated in cells-gtk.
Andy, if you could send us a more detailed description of the problem, that might help trigger our recollection from the cells-gtk3 migration.
Peter
Sorry Peter, I forgot to hit "Reply to all"
On Mon, Jun 16, 2008 at 2:33 PM, Peter Hildebrandt peter.hildebrandt@gmail.com wrote:
Off the top of my head (Disclaimer: I might mix things up here), Ken identified some recently introduced constrained in cells which collided with the way menus were instantiated in cells-gtk.
Andy, if you could send us a more detailed description of the problem, that might help trigger our recollection from the cells-gtk3 migration.
Well, besides some little asdf hurdles, when you try to run (tk-test), it fails when trying to call dictionary with NIL in the first make-tk-instance.
So for some reason, (nearest self window) is returning nil.
Cheers, Andy
Andy Chambers wrote:
Hi,
I made a notebook widget for celtk. It just uses the built-in tile notebook and introduces a "tab" widget which is just a container for stuff you can add to a notebook.
Now in CVS.
On a separate note, I was having trouble getting the latest versions of cells and celtk to play nicely together. I reverted back to cells from March to work on this stuff since that's when I was last working on my expander widget. I'll investigate the problems and try to provide some more useful input later this week.
Not sure what is what, but the test function works with my latest code, all of which has also now been committed to CVS. I do have a an appearnce issue (no 3d borders on widgets) but I saw that a while ago and did not bother investigating.
kt