Search code examples
pygtkbarcode-scanner

Set focus on entry that is not visible in pyGTK


I want to set focus on entry that is not visible in pyGTK for a barcode scanner.

If I set entry to visible false then I get this error when setting focus on it.

    /home/samuel/visitors-book/visitors_book/__init__.py:60: GtkWarning: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
  gtk.main()

Thanks Sam


Solution

  • You could do without a GtkEntry and capture the keyboard events directly.

    But is it so bad to have the entry visible? All barcode terminals I've seen confirm what is read.