mirror of https://codeberg.org/cage/tinmop/
- added functions to set meesages on the info-bar.
This commit is contained in:
parent
393b4b0d29
commit
86adc4638d
|
@ -6,6 +6,8 @@
|
|||
|
||||
(defparameter *gui-server* nil)
|
||||
|
||||
(defparameter *main-frame* nil)
|
||||
|
||||
(a:define-constant +font-h1+ "sans 20 bold" :test #'string=)
|
||||
|
||||
(a:define-constant +font-h2+ "sans 15 bold" :test #'string=)
|
||||
|
|
|
@ -287,6 +287,7 @@
|
|||
(setf gemtext-widget (make-instance 'gui:scrolled-text :master object))
|
||||
(setf info-frame (make-instance 'gui:frame :master object :relief :sunken :borderwidth 1))
|
||||
(setf info-text (make-instance 'gui:text :height 1 :wrap :none :master info-frame))
|
||||
(gui:configure info-text :font gui:+tk-small-caption-font+)
|
||||
(gui:grid info-text 0 0 :sticky :news)
|
||||
(gui-goodies:gui-resize-grid-all info-frame)
|
||||
(gui:grid tool-bar 0 0 :sticky :new :columnspan 2)
|
||||
|
@ -297,6 +298,25 @@
|
|||
(gui:grid-rowconfigure object 1 :weight 1)
|
||||
object))
|
||||
|
||||
(defun print-info-message (message &key (color (gui-goodies:parse-color "gray")) (bold nil))
|
||||
(let ((info-widget (info-text gui-goodies:*main-frame*)))
|
||||
(setf (gui:text info-widget) message)
|
||||
(let ((color-tag (gui:tag-create info-widget
|
||||
(nodgui.utils:create-tag-name)
|
||||
(gui:make-indices-start)
|
||||
(gui:make-indices-end))))
|
||||
(if bold
|
||||
(gui:tag-configure info-widget
|
||||
color-tag
|
||||
:foreground color
|
||||
:font "bold")
|
||||
(gui:tag-configure info-widget
|
||||
color-tag
|
||||
:foreground color)))))
|
||||
|
||||
(defun print-error-message (message)
|
||||
(print-info-message message :color (gui-goodies:parse-color "red") :bold t))
|
||||
|
||||
(defun init-main-window ()
|
||||
(gui:with-nodgui (:title +program-name+)
|
||||
(icons:load-icons)
|
||||
|
@ -305,5 +325,6 @@
|
|||
(setf gui-goodies:*gui-server* gui:*wish*)
|
||||
(client-events:start-events-loop)
|
||||
(let ((main-frame (make-instance 'main-frame)))
|
||||
(setf gui-goodies:*main-frame* main-frame)
|
||||
(gui:grid main-frame 0 0 :sticky :nswe)
|
||||
(gui-goodies:gui-resize-grid-all gui-goodies:*toplevel*))))
|
||||
|
|
|
@ -3323,6 +3323,7 @@
|
|||
(:export
|
||||
:*toplevel*
|
||||
:*gui-server*
|
||||
:*main-frame*
|
||||
:parse-color
|
||||
:make-font
|
||||
:gui-resize-grid-all
|
||||
|
|
Loading…
Reference in New Issue