Using Zenity is possible to add buttons,change fonts ,anything besides default options? If not,there's another dialog for sh that allows more customizing?
A:
You can probably change the style with the ~/.gtkrc
file, but that can be painful. You might want to just move on up to writing real GUI programs with Gtk2-Perl:
#!/usr/bin/perl
use strict;
use warnings;
use Gtk2;
Gtk2->init;
my $window = Gtk2::Window->new;
my $vbox = Gtk2::VBox->new;
my $label = Gtk2::Label->new("Hello World");
my $button = Gtk2::Button->new("Press me");
$window->add($vbox);
$vbox->add($label);
$vbox->add($button);
$window->set_default_size(200, 200);
$window->signal_connect(
destroy => sub {
Gtk2->main_quit;
}
);
my $i = 0;
$button->signal_connect(
clicked => sub {
$label->set_text("button pressed " . ++$i . " times");
}
);
$window->show_all;
Gtk2->main;
Chas. Owens
2009-04-20 19:46:39
+2
A:
Zenity supports a few HTML-like tags for text markup: <b>
, <i>
, <u>
, <s>
, <tt>
, <big>
, <small>
, and more -- well, really it's Gtk+ that supports those tags, but Zenity gets to piggyback on top of those features.
For more control over your dialogs, you can intead use Kommander. It's like a form builder compatible with all sorts of scripting languages: Python, Perl, Ruby, shell. There's various examples out there.
ephemient
2009-04-20 19:58:24