Re: vertical size of buttons



Hi,
The buttons fill the box because that is the default behavior (there has
to be one).  If you want to change their size, use set_usize like this:
$DataBaseButton->set_usize(100,50); # args are x,y

HTH
--john

Subject: vertical size of buttons
From: Peter Jay Salzman <p dirac org>

hello all,

for some reason, my buttons are deciding to fill up their containing
hbox in the vertical direction.

i use the following routine to make buttons next to text entry widgets:

  $MainHBox->pack_start($LeftMainVBox, $false, $false, 0);
  ...
  $tmpHBox = new Gtk::HBox($false, 0);
  my $DataBaseEntry = new Gtk::Entry();
  FramePacker($DataBaseEntry, "Database", $tmpHBox);
  my $DataBaseButton = MakeButton("Database", $tmpHBox, "DataBaseClick");
  $LeftMainVBox->pack_start($tmpHBox, $false, $false, 0);

  sub MakeButton {
     my ($label, $PackingBox, $callback) = @_;
     my $widget = new Gtk::Button($label);
     $widget->signal_connect("clicked", $callback);
     $PackingBox->pack_start($widget, $true, $false, 1);
     return $widget;
  }

  sub FramePacker {
     my $widget = shift;
     my $label = shift;
     my $packingbox = shift;
     my $frame = new Gtk::Frame($label);
     $frame->add($widget);
     $packingbox->pack_start($frame, $true, $true, 0);
  }

the buttons themselves fill the entire hbox that i pack them into.  so
an hbox that contains a text entry and a button looks like:

   ----------------------------------------------------------
        | -----------------------------------      -----------   |
        | |                                 |      |         |   |
        | |   Text Entry                    |      |Click Me |   |
        | |                                 |      |         |   |
        | -----------------------------------      -----------   |
   ----------------------------------------------------------

and (you have to take my word for it) it looks very unnatural.  what i
*want* to happen is:

   ----------------------------------------------------------
        | -----------------------------------                    |
        | |                                 |      -----------   |
        | |   Text Entry                    |      |Click Me |   |
        | |                                 |      -----------   |
        | -----------------------------------                    |
   ----------------------------------------------------------

can someone explain why the buttons are deciding to fill up the hbox in
the vertical direction?


-- 
John McDermott, Writer and Consultant
J-K International, Ltd.
V +1 505/377-6293  F +1 505/377-6313
jjm jkintl com



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