GNOME Bugzilla – Bug 746303
Fomatting the text in a spinbutton does not work
Last modified: 2021-07-05 12:22:08 UTC
I tried to display the value of a spinbutton in hexadecimal form. It is always displayed in decimal. Example code: #!/usr/bin/perl use strict; use warnings; use Gtk2 -init; my $dialog = Gtk2::Dialog->new('Test', undef, [ 'GTK_DIALOG_MODAL', 'GTK_DIALOG_DESTROY_WITH_PARENT' ], ('gtk-close', 'close')); sub _cb_spin($$) { my ($widget, $self) = @_; my $value = $widget->get_value_as_int(); my $str = sprintf("0x%x", $value); $widget->set_text("$str"); return 0; } my $vbox = $dialog->get_content_area(); my $spin = Gtk2::SpinButton->new_with_range(0x0, 0x70000, 0x10000); $spin->signal_connect('output', \&_cb_spin); $spin->set_value(0x30000); $vbox->add($spin); $vbox->show_all(); $dialog->run; The callback is active, but the text does not change. When returning '1' from the callback, i get no output at all.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME?utf8=%E2%9C%93&filter=perl- Thank you for your understanding and your help.