fix-widget?
fix-widget-new-geometry-callback fix-widget-realize-callback
- set-fix-widget-map-handler!
- set-fix-widget-unmap-handler!
set-fix-widget-enter-notify-handler!
set-fix-widget-leave-notify-handler!
set-fix-widget-focus-change-handler!
(%trace ";with-gtk-interrupts-disabled => "v"\n")
v)))
-(define (map-handler widget)
- (%trace "; Mapped: "widget"\n")
- (if (and (text-widget? widget)
- (not (text-widget-modeline widget)))
- (%trace "; grab-focus "widget"\n")
- (gtk-widget-grab-focus widget))
- #f)
-
-(define (unmap-handler widget)
- (%trace "; Unmapped: "widget"\n")
- #f)
-
(define (focus-change-handler widget in?)
(%trace "; Focus-"(if in? "in" "out")": "widget"\n")
(let ((screen (edwin-widget-screen widget)))
(fix-rect-height extent))))
(set-text-widget-override-drawing! widget drawing)
(set-fix-layout-drawing! widget drawing 0 0))
- (set-fix-widget-map-handler! widget map-handler)
- (set-fix-widget-unmap-handler! widget unmap-handler)
(set-fix-widget-focus-change-handler! widget focus-change-handler)
(set-fix-widget-visibility-notify-handler! widget visibility-notify-handler)
(set-fix-widget-key-press-handler! widget key-press-handler)
(%widget-x-size window screen)
(%widget-y-size window screen))
(%trace "; initialized geometry: "geometry"\n"))))
+ ;; The typein widget is undisturbed by window changes, so grab-focus
+ ;; once here.
+ (if (not (text-widget-modeline widget))
+ (gtk-widget-grab-focus widget))
(call-next-method widget))
(define-method fix-widget-new-geometry-callback ((widget <text-widget>))
(let ((drawing (make-fix-drawing)))
;;; (%trace "; drawing: "drawing"\n")
(set-fix-layout-drawing! widget drawing 0 0))
- (set-fix-widget-map-handler! widget map-handler)
- (set-fix-widget-unmap-handler! widget unmap-handler)
(set-fix-widget-focus-change-handler! widget focus-change-handler)
(set-fix-widget-visibility-notify-handler! widget visibility-notify-handler)
(set-fix-widget-key-press-handler! widget key-press-handler)
(define event-mask
(bit-ior
- ;; GDK_MAP
- ;; GDK_UNMAP
(C-enum "GDK_ENTER_NOTIFY_MASK")
(C-enum "GDK_LEAVE_NOTIFY_MASK")
(C-enum "GDK_FOCUS_CHANGE_MASK")
(C-enum "GDK_KEY_PRESS_MASK")
(C-enum "GDK_POINTER_MOTION_MASK")
(C-enum "GDK_BUTTON_PRESS_MASK")
- (C-enum "GDK_BUTTON_RELEASE_MASK")
- ;; GDK_2BUTTON_PRESS
- ;; GDK_3BUTTON_PRESS
- ))
+ (C-enum "GDK_BUTTON_RELEASE_MASK")))
(define-generic fix-widget-unrealize-callback (widget))
(and handler
(handler widget GdkEvent)))))
-(define (set-fix-widget-map-handler! widget handler)
- (guarantee-fix-widget widget 'set-fix-widget-map-handler!)
- (guarantee-procedure-of-arity handler 1 'set-fix-widget-map-handler!)
- (vector-set!
- (fix-widget-event-handlers widget) (C-enum "GDK_MAP")
- (named-lambda (fix-widget-map-handler widget GdkEvent)
- (declare (ignore GdkEvent))
- (handler widget))))
-
-(define (set-fix-widget-unmap-handler! widget handler)
- (guarantee-fix-widget widget 'set-fix-widget-unmap-handler!)
- (guarantee-procedure-of-arity handler 1 'set-fix-widget-unmap-handler!)
- (vector-set!
- (fix-widget-event-handlers widget) (C-enum "GDK_UNMAP")
- (named-lambda (fix-widget-unmap-handler widget GdkEvent)
- (declare (ignore GdkEvent))
- (handler widget))))
-
(define (set-fix-widget-enter-notify-handler! widget handler)
(guarantee-fix-widget widget 'set-fix-widget-enter-notify-handler!)
(guarantee-procedure-of-arity handler 1 'set-fix-widget-enter-notify-handler!)
fix-widget-realize-callback
fix-widget-unrealize-callback
set-fix-widget-pointer-shape!
- set-fix-widget-map-handler!
- set-fix-widget-unmap-handler!
set-fix-widget-enter-notify-handler!
set-fix-widget-leave-notify-handler!
set-fix-widget-focus-change-handler!
@end deffn
@deffn Procedure gtk-widget-drawable? widget
-@code{#t} if @var{widget} can be drawn, i.e. it is mapped and visible.
+@code{#t} if @var{widget} can be drawn, i.e. it is realized and visible.
@end deffn
@deffn Procedure gtk-widget-grab-focus widget
Causes @var{widget} to have the keyboard focus for the GtkWindow it's
inside. @var{Widget} must be a focusable widget, such as a GtkEntry;
something like a GtkFrame will not work. The widget also needs to be
-realized and mapped. Grabbing the focus immediately after creating
+realized. Grabbing the focus immediately after creating
the widget will likely fail and cause critical warnings.
@end deffn
@bref{gtk-widget-show-all} on the container. Note that the containers
containing @var{widget} must also be ``shown'' else @var{widget}
cannot be displayed. When a toplevel container is shown, it is
-immediately realized and mapped, as well as any descendents that are
+immediately realized, as well as any descendents that are
``showing''.
@end deffn
By setting the type hint for @var{window}, you allow the window
manager to decorate and handle the window in a way which is suitable
to the function of the window in your application. This function
-should be called before mapping @var{window}. @var{Hint} can be one
+should be called before realizing @var{window}. @var{Hint} can be one
of the symbols in the following table. See the Extended Window
Manager Hints specification at
@uref{http://www.freedesktop.org/Standards/wm-spec} for more details
This procedure is called when @var{widget} is being realized.
@end deffn
-@deffn Procedure set-fix-widget-map-handler! widget handler
-Arranges to apply @var{handler} to @var{widget} when it is mapped.
-@var{handler} must return @code{#t} or @code{#f}.
-@xref{event-handler-note}.
-@end deffn
-
-@deffn Procedure set-fix-widget-unmap-handler! widget handler
-Arranges to apply @var{handler} to @var{widget} when it is unmapped.
-@var{handler} must return @code{#t} or @code{#f}.
-@xref{event-handler-note}.
-@end deffn
-
@deffn Procedure set-fix-widget-enter-notify-handler! widget handler
Arranges to apply @var{handler} to @var{widget} when the pointer
enters.