Re: Remove spaces in dialog window



muppet wrote:
Either use Glib::Object::Subclass to subclass Gtk2::Dialog (or any widget), or
rebless the actual widget like this:

   my $self = $class->SUPER::new(...);
   bless $self, $class;

Thanks.

You didn't show enough code to get full context, so there are several
possibilities.

Are you adding responses to your Gtk2::Dialog?  The extra space may be the
empty action area hbox at the bottom of the window.


package Properties;

use strict;
use constant { TRUE  => 1,
               FALSE => 0 };

our @ISA = qw(Gtk2::Dialog);

sub new
{
   my ($class, $parent, $title)  = @_;

   my $self = $class->SUPER::new($title, $parent, "modal");
   bless($self, $class);

   $self->set_has_separator(FALSE);
   #$self->set_resizable(FALSE);
   #$self->set_default_size(5, 5);

   my $lb = Gtk2::Label->new("My Label");
   my $bt = Gtk2::Button->new("my Button");

   my $chk1 = Gtk2::CheckButton->new("Check box 1");
   my $chk2 = Gtk2::CheckButton->new("Check box 2");
   my $chk3 = Gtk2::CheckButton->new("Check box 3");

   $self->vbox->pack_start($lb,FALSE,FALSE,0);
   $self->vbox->pack_start($chk1,FALSE,FALSE,0);
   $self->vbox->pack_start($chk2,FALSE,FALSE,0);
   $self->vbox->pack_start($chk3,FALSE,FALSE,0);
   $self->vbox->pack_start($bt,FALSE,FALSE,0);

   $self->show_all;

   return;
}

1;
-------------

There is extra space between button and lower border of dialog window.


Did you set a default size for the window?  If so, then that's probably
leaving plenty of space due to packing parameters.

Im afraid not.
Is there any side effect when setting default size smaller than actual size of widget?

Whats the usefullness of using new_with_mnemonic in Label, since afaik Gtk2::Label is readonly widget.

--

--beast




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