;;;; $Id: menus-extras.scm,v 1.16 2006/03/05 03:19:53 dsmith Exp $ ;;;; Copyright (C) 1997, 1998, 1999, 2000 Maciej Stachowiak and Greg J. Badros ;;;; ;;;; This program is free software; you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by ;;;; the Free Software Foundation; either version 2, or (at your option) ;;;; any later version. ;;;; ;;;; This program is distributed in the hope that it will be useful, ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;;; GNU General Public License for more details. ;;;; ;;;; You should have received a copy of the GNU General Public License ;;;; along with this software; see the file COPYING. If not, write to ;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, ;;;; Boston, MA 02111-1307 USA ;;;; (define-module (app scwm menus-extras) :use-module (app scwm base) :use-module (app scwm defoption) :use-module (app scwm optargs)) (define-public (menu-max-fold-lines) "Return an approximation of the number of menuitems that will fit vertically on screen." (let* ((menu-font-property menu-font) (menu-font (if (symbol? menu-font-property) (eval menu-font-property) menu-font-property)) (menu-font-height (assoc-ref (font-properties menu-font) 'height))) (round/ (cadr (display-size)) (+ 7 menu-font-height)))) (define-public (sorted-by-car-string l) "Sort the elements of list L based on the string value of their `car'. Uses string