Re: Button alignment in Gtk2::Tables



On 24.07.2012 12:08, Aaron Lewis wrote:
On the bottom row are two Gtk2::CheckButtons. The first one is supposed
to be left-aligned (and is); the second is supposed to be right-aligned
(but is left-aligned, like the first one).

Your call to $checkButton2->set_alignment actually resolves to Gtk2::Button::set_alignment and consequently sets the alignment of the child of the button (i.e., the checkbox), not the "outer" alignment of the checkbox. This works for Gtk2::Label because it derives from Gtk2::Misc. Remove the $checkButton2->set_alignment call and try this:

        my $aligner2 = Gtk2::Alignment->new(0.5, 0.5, 0, 0);
        $aligner2->add($checkButton2);
        $table->attach_defaults($aligner2, 1, 2, 1, 2);



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