Re: Horizontal aligned columns



Thomas Wallrafen said:
Hi all!

I've just begun programming with gtk so please forgive my lack of
knowledge.

I am trying to create an application with the look of a table, e.g. I'd like
to have two left-aligned columns in the program.
So far I tried both the table-widget and a vbox containing several hboxes.
Creating two columns is a fairly easy job (using the table wiget), but
aligning these to the left seems to be quite different, since  the several
expand and fill options are a bit confusing.

Do you have any suggestions, hints or pointers to further literature?

for labels:  GtkLabel is a subclass of GtkMisc, for which you can call
gtk_misc_set_alignment(label, xalign, yalign), to, you guessed it, set the
alignment.

   my $label = Gtk::Label->new ('fpp');
   $label->set_alignment (0.0, 0.5); # left aligned
   $label->set_alignment (1.0, 0.5); # right aligned
   $label->set_alignment (0.5, 0.0); # top aligned
   $label->set_alignment (1.0, 1.0); # bottom-right aligned

the align parameter is a float [0.0, 1.0], where 0.0 is top/left, 1.0 is
bottom/right, and 0.5 is centered.


for arbitrary widgets, you can pack them into GtkAlignment containers and to
pretty much the same thing.


-- 
muppet <scott at asofyet dot org>





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