Re: error dialog not centered



        Hi,

Beast wrote:

I have these following code:

...

sub cb_ok {
   my $self = shift;
   ...
my $dialog = Gtk2::MessageDialog->new($self, 'modal', 'error', 'ok', $message);

        See : http://gtk2-perl.sourceforge.net/doc/pod/Gtk2/MessageDialog.html

The first arg should be a Gtk2::Window. So you should use $self->window (if I remember correctly).

   $dialog->set_position('center-on-parent');
}

But it behave like I wanted.

1. The error pop-up did not center in their parrent, but seems on top-left of screen.

        See above.

2. How to make the "OK" button centered (presently it right alignment)?
3. How to remove the icon on the "OK" button?

This is not good practice. This should be done by the theme choosen by the user.

        HTH,
--
--      \^/                                            --
--    -/ O \---------------------------------------    --
--   | |/ \|      Alexandre (Midnite) Jousset      |   --
--    -|___|---------------------------------------    --



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