[ltk-user] Toplevel Question

Peter Herth herth at peter-herth.de
Thu Oct 15 20:13:32 UTC 2009


On Sun, Oct 11, 2009 at 10:47 PM, Wesley Kerr <wkerr at cs.arizona.edu> wrote:
> I think that this is a simple question, but I can't figure out how to
> find a handle for the top-level that is automatically created when we
> call (start-wish).  Is there a way to get it so that I can set the
> title and do other fun stuff with it?

That handle would be *tk*, e.g.: (wm-title *tk* "Data Mining")

Peter


>
> Here is some code that shows what I want to do:
>
> (defun data-mining-gui ()
>    (with-ltk ()
>      (let* ((top-frame (make-instance 'frame
>                                       :pack '(:side :top :expand t :fill :x
>                                               :anchor :ne)))
>             (bload (make-instance 'button :master top-frame
>                                   :text "Load..."
>                                   :command 'data-mining-gui-load-file))
>             (bottom-frame (make-instance 'frame
>                                          :pack '(:side :bottom
> :expand t :fill :x
>                                                  :anchor :se)
>                                          :borderwidth 2 :relief :raised))
>             (label (make-instance 'label :master bottom-frame :text "Active:"))
>             (lfile (make-instance 'label :master bottom-frame :text ""))
>             (sc (make-instance 'scrolled-canvas
>                                :pack '(:side :top :fill :both :expand t
>                                        :anchor :ne)
>                                :width 600 :height 600))
>             (canvas (canvas sc))
>             )
>
>        (pack (list bload label lfile) :side :left)
>        (make-menubar)
>        ;;; I want to set the title of the window to "Data Mining" but
> can't figure out where the handle is.
>        ;(wm-title nil "Data Mining")
>
>        (setf *canvas* canvas)
>        (setf *file-label* lfile)
>        ))
>    ))
>
>
> Thanks
>
> Wes
>
> --
> Wesley Kerr
> Graduate Research Assistant
> Department of Computer Science
> University of Arizona
>
> website: http://www.cs.arizona.edu/~wkerr
>
> _______________________________________________
> ltk-user site list
> ltk-user at common-lisp.net
> http://common-lisp.net/mailman/listinfo/ltk-user
>




More information about the ltk-user mailing list