Added gffi to the list of used packages and cleaned up
[clg] / gtk / gtkwidget.lisp
index 142548b..a2fe742 100644 (file)
@@ -20,7 +20,7 @@
 ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-;; $Id: gtkwidget.lisp,v 1.20 2006-02-26 15:24:46 espen Exp $
+;; $Id: gtkwidget.lisp,v 1.22 2006-04-25 20:19:32 espen Exp $
 
 (in-package "GTK")
 
@@ -333,10 +333,12 @@ received."
   (state state-type)
   (color gdk:color))
 
-(defbinding widget-modify-font () nil
+(defbinding widget-modify-font (widget font-desc) nil
   (widget widget)
-  (state state-type)
-  (font-desc pango:font-description))
+  ((etypecase font-desc
+     (pango:font-description font-desc)
+     (string (pango:font-description-from-string font-desc)))
+   pango:font-description))
 
 (defbinding widget-create-pango-context () pango:context
   (widget widget))
@@ -486,8 +488,12 @@ received."
   (event gdk:event))
 
 (defun (setf widget-cursor) (cursor-type widget)
-  (let ((cursor (make-instance 'gdk:cursor :type cursor-type)))
-    (gdk:window-set-cursor (widget-window widget) cursor)))
+  (warn "(SETF WIDGET-CURSOR) is deprecated, use WIDGET-SET-CURSOR instead")
+  (widget-set-cursor widget cursor-type))
+
+(defun widget-set-cursor (widget cursor &rest args)
+  (gdk:window-set-cursor (widget-window widget) 
+   (apply #'gdk:ensure-cursor cursor args)))
 
 (defbinding %widget-get-parent-window () gdk:window
   (widget widget))