Gtk2::SpinButton For Hex

How can I use a Gtk2::SpinButton to prompt for an integer expressed in hex?  I’ve tried the following, but it fails.


   use strict;

   use warnings;


   use Glib qw(TRUE FALSE);

   use Gtk2 qw(-init);




   $spin->signal_connect(output => \&outputCB);


   my($win)=new Gtk2::Window();






   sub outputCB


      my($spin)= _;



      $spin->set_text(sprint ‘%X’,$value);



The text appears to be correct while I hold either arrow button down; I see hex values incrementing.  However, single clicks of an arrow button fail if the displayed text contains A-F.  Hitting the Enter key also fails on the same values.  In both cases, the text changes to a decimal integer.





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