mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 10:40:45 -08:00
Add menu from clog-gui to tutorial 26
This commit is contained in:
parent
43e51cc367
commit
c95f8e1e3e
3 changed files with 23 additions and 7 deletions
|
|
@ -165,7 +165,8 @@
|
|||
(defun clog-gui-initialize (clog-body &key (w3-css-url "/css/w3.css")
|
||||
(jquery-ui-css "/css/jquery-ui.css")
|
||||
(jquery-ui "/js/jquery-ui.js"))
|
||||
"Initializes clog-gui and installs a clog-gui object on connection."
|
||||
"Initializes clog-gui and installs a clog-gui object on connection.
|
||||
If W3-CSS-URL has not been loaded before is installed unless is nil."
|
||||
(create-clog-gui clog-body)
|
||||
(set-on-full-screen-change (html-document clog-body)
|
||||
(lambda (obj)
|
||||
|
|
@ -179,8 +180,10 @@
|
|||
(when (window-maximized-p (current-window obj))
|
||||
(window-normalize (current-window obj))
|
||||
(window-maximize (current-window obj))))))
|
||||
(when w3-css-url
|
||||
(load-css (html-document clog-body) w3-css-url))
|
||||
(unless (connection-data-item clog-body "w3-css")
|
||||
(when w3-css-url
|
||||
(setf (connection-data-item clog-body "w3-css") t)
|
||||
(load-css (html-document clog-body) w3-css-url)))
|
||||
(when jquery-ui-css
|
||||
(load-css (html-document clog-body) jquery-ui-css))
|
||||
(when jquery-ui
|
||||
|
|
|
|||
|
|
@ -108,10 +108,13 @@
|
|||
;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defun clog-web-initialize (clog-body &key (w3-css-url "/css/w3.css"))
|
||||
"Initializes clog-web and installs a clog-web object on connection."
|
||||
"Initializes clog-web and installs a clog-web object on connection.
|
||||
If W3-CSS-URL has not been loaded before is installed unless is nil."
|
||||
(create-clog-web clog-body)
|
||||
(when w3-css-url
|
||||
(load-css (html-document clog-body) w3-css-url)))
|
||||
(unless (connection-data-item clog-body "w3-css")
|
||||
(when w3-css-url
|
||||
(setf (connection-data-item clog-body "w3-css") t)
|
||||
(load-css (html-document clog-body) w3-css-url))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; set-maximum-page-width-in-pixels ;;
|
||||
|
|
|
|||
|
|
@ -9,14 +9,24 @@
|
|||
|
||||
|
||||
(defpackage #:clog-user
|
||||
(:use #:cl #:clog #:clog-web)
|
||||
(:use #:cl #:clog #:clog-web #:clog-gui)
|
||||
(:export start-tutorial))
|
||||
|
||||
(in-package :clog-user)
|
||||
|
||||
(defun on-new-window (body)
|
||||
(clog-web-initialize body)
|
||||
(clog-gui-initialize body)
|
||||
(setf (title (html-document body)) "Tutorial 26")
|
||||
;; Install a menu
|
||||
(let* ((menu (create-gui-menu-bar body))
|
||||
(tmp (create-gui-menu-icon menu :on-click (lambda (obj)
|
||||
(setf (hash (location body)) "rung2"))))
|
||||
(tmp (create-gui-menu-item menu :content "About"
|
||||
:on-click (lambda (obj)
|
||||
(setf (hash (location body)) "rung2"))))
|
||||
(tmp (create-gui-menu-full-screen menu)))
|
||||
(declare (ignore tmp)))
|
||||
;; rung-1
|
||||
(let* ((first-rung (create-web-compositor body :html-id "rung1"))
|
||||
(image (create-img first-rung :url-src "/img/windmills.jpg"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue