I don't have my tablet with me, but the error gets thrown on my desktop PC system (with MS wintab SDK and WACOM drivers installed) too.

===tabinfo.py===
Hardware identification string : "Wintab Digitizer Services"
Specification version number : 1.2
Implementation version number : 1.39
Number of devices supported : 0
Number of cursor types supported : 0
Number of contexts supported : None
Context options supported : 0xd
Size of the save information : 172
Number of extension data items : 1
Number of manager handles supp. : 9

------------------------------ Extension 0 ------------------------------
Extension name : "Cursor Mask"
Identifier : 3
Mask : None
Size (abs, rel) : None
Axis descriptions : None
Default data : None
Default context data : [16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16]
Default system context data : [16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16]
Cursor specific data : None

==tabtst.py===
...
HWND: 2557586
Traceback (most recent call last):
File "tabtst.py", line 126, in ?
main()
File "tabtst.py", line 71, in main
ctx.open(hwnd, True)
RuntimeError: Could not open Wintab device context

===tabdemo.py===
Traceback (most recent call last):
File "tabdemo.py", line 5, in ?
TargetCamera(
NameError: name 'TargetCamera' is not defined


Don't know if this helps. Other pen-based apps work fine (on both the tablet and desktop which uses driver simulation). I'll try it again on the tablet and report back if the problem persists.


On 5/4/06, Matthias Baas <baas@ira.uka.de> wrote:
Hi,

> Is there some example code on how to use the wintab module? I tried the
> following code:

Well, your code works for me...

> packets = packetsGet(2)

...except for this line. This should be:

packets = context.packetsGet(2)


Maybe there's a problem with the driver? Can you use your tablet with
other applications?

I've attached some scripts to this mail:

- tabinfo.py: This just displays some tablet information obtained from
the driver

- tabtst.py: This just opens a window and print some events (such as
when you enter or leave the tablet with your stylus). It requires a
recent version of pygame to run.

- tabdemo.py: You have to run this via the cgkit viewer tool ( viewer.py
tabdemo.py). You should see a plane on which you can "draw" (only for
testing purposes). Your stylus is represented by a cylinder.

Do this scripts work?

- Matthias -