Re: ToggleButton Change Icon




This is the code I have so far, which works, but it is placing the stock text message for the icon to the right of the icon image. So for the stop it looks like (X) Stop instead of
(X)
Stop The rest of my buttons in the toolbar I'm adding $toolbar->insert_stock and the icon button is a square, the image is at the top and the text is at the bottom. Is there anyway to get this button to match what my other buttons look like on the toolbar?
my $button_start = Gtk2::Button->new_from_stock('gtk-execute');
$button_start->signal_connect (clicked => sub {
              if ($start == 0 ) {
                 $_[0]->set_label('gtk-stop');
                 $_[0]->set_use_stock(TRUE);
                 $start = 1;
                 Glib::Timeout->add(2000, \&start_cb );
              } else {
                 $_[0]->set_label('gtk-execute');
                 $_[0]->set_use_stock(TRUE);
                 $start = 0;
                }
}); $toolbar->insert_widget ($button_start, undef, undef, -1); Thanks for your time, Ben





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