GtkSpinButton & modified arrow keys



I'm using Gtk1.3.9 (well, whatever comes out of CVS).  On many entry-like
widgets I would like to bind the up/down arrow keys with modifiers (control
or alt) to some application-specific functions.  I'm experimenting with
SpinButton right now.  It's frustrating because the code in gtkspinbutton.c
seems to capture arrow key presses but ignores the state of the modifier
keys.  Is that intentional?  Seems to me that it should be checking the
events's state field for modifiers and returning FALSE if any modifier keys
are pressed.  Am I reading the code wrong or misunderstanding what key
presses the SpinButton expects to gobble up?

Here's a trivial Python script that I'm using.

    import gtk

    window = gtk.Window(gtk.WINDOW_TOPLEVEL)
    window.connect("destroy", gtk.mainquit)

    adj = gtk.Adjustment(1200, 0, 10000, 1.0, 100.0, 0.0)
    s1 = gtk.SpinButton(adjustment=adj, digits=0)
    window.add(s1)

    window.show_all()

    gtk.mainloop()

If I press the up or down arrow keys, it spins the number, regardless what
modifier keys I've got pressed.

-- 
Skip Montanaro (skip pobox com)
http://www.mojam.com/
http://www.musi-cal.com/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]