[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug in focus management
From: |
Stan Pinte |
Subject: |
bug in focus management |
Date: |
Sun, 16 Feb 2003 16:44:17 +0100 |
hello,
I guess we have a bug in our focus management code, in guile-gtk-1.2-0.31.
Indeed, when a widget has the focus, a call to (gtk-widget-get ref-entry
'has-focus) returns #f.
the following code should proof the point.
Any idea?
thanks a lot,
Stan.
(use-modules (ice-9 format))
(use-modules (gtk gtk))
(let ((window (gtk-window-new 'toplevel))
(button (gtk-button-new-with-label "Say Hello"))
(ref-entry (gtk-entry-new)))
(gtk-widget-set-name button "mybutton")
(gtk-widget-set-name window "mywindow")
(gtk-window-set-title window "Guile-Gtk: Hello World")
(gtk-container-border-width window 10)
; (gtk-container-add window button)
(gtk-container-add window ref-entry)
(gtk-signal-connect ref-entry "insert-text"
(lambda (new-text new-length position)
(if (string? new-text)
(format #t "inserted: [~c]~%" (string-ref new-text
0))
(format #t "not text!!!~n"))))
;;;shows the problem
(gtk-signal-connect ref-entry "focus-in-event"
(lambda (entry)
(format #t "focused [~A]. Has focused: ~A ~%"
ref-entry
(gtk-widget-get ref-entry 'has-focus))))
;;;end of problem
(gtk-widget-show-all window)
(gtk-standalone-main window))
--
Stanislas Pinte
Computer Consultant
98, rue Bois l'Evêque
B-4000 Liège
web: http://www.altosw.be
email: address@hidden
- bug in focus management,
Stan Pinte <=