After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 464574 - please wrap the 'input' signal for spinbutton
please wrap the 'input' signal for spinbutton
Status: RESOLVED WONTFIX
Product: pygtk
Classification: Bindings
Component: gtk
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
gnome[unmaintained]
Depends on:
Blocks:
 
 
Reported: 2007-08-08 04:16 UTC by Bug flys
Modified: 2018-08-17 13:42 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
patch with example how this could be done (1.20 KB, patch)
2007-08-10 15:04 UTC, Paul Pogonyshev
none Details | Review
example, showing new do_input in action (727 bytes, text/plain)
2007-08-10 15:05 UTC, Paul Pogonyshev
  Details
example with value_obj.value API (751 bytes, text/plain)
2007-08-12 14:06 UTC, Bug flys
  Details

Description Bug flys 2007-08-08 04:16:25 UTC
I was trying to write a clock (hh:mm:ss) by subclass spinbutton. If I cound not handle the 'input' signal, the spinbutton always pickups the first digits (hh) and updates adjustment with it. 

I need a way to pass back different digits depending on the cursor location.

Could you add a SpinButton.connect_signal_input(pyobject, ...) function which connect to the 'input' signal. User can pass back the calculated value using the pyobject.value attribute. 

Or using some other smarter tricks.
Comment 1 Paul Pogonyshev 2007-08-10 15:04:02 UTC
Created attachment 93441 [details] [review]
patch with example how this could be done

This patch only allows to handle 'input' signal with default handler (do_input), I cannot figure out how to do this for other handlers.  Seems like this is impossible with current PyGObject infrastructure...
Comment 2 Paul Pogonyshev 2007-08-10 15:05:56 UTC
Created attachment 93442 [details]
example, showing new do_input in action

Note that _on_input() (handler to be connected) still uses current semantics and is therefore useless.  But do_input() becomes useful with the patch above.
Comment 3 Bug flys 2007-08-12 14:06:41 UTC
Created attachment 93540 [details]
example with value_obj.value API

What's in my mind is something like do_input(self, value_obj) and the actual value was assigned to value_obj.value.

That way, the do_input can still return boolean.

Anyway, since only the default handler can be override, I guess returning boolean is not much meaningful.
Comment 4 André Klapper 2018-08-17 13:42:10 UTC
pygtk is not under active development anymore and had its last code changes
in 2013. Its codebase has been archived:
https://gitlab.gnome.org/Archive/pygtk/commits/master

PyGObject at https://gitlab.gnome.org/GNOME/pygobject is its successor. See https://pygobject.readthedocs.io/en/latest/guide/porting.html for porting info.

Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect
reality. Feel free to open a task in GNOME Gitlab if the issue described in this task still applies to a recent version of PyGObject. Thanks!