Re: Text Field layout




        Sorry if I'm late with this ... you probably figured it ou already but
anyhow ...


No problem ... Just use GtkFixed .. and than gtk_container_add( ... x y
w h );
If you wan to theme use libglade and glade_xml_new and
glade_xml_get_widget(widget name)
its so point and click it makes me sick ! (but its the easiest way
around glade will alse aute-generate C / C++ code)


        -Tristan Van Berkom



"William L. Thomson Jr." wrote:

On Mon, 2002-06-17 at 17:55, James M. Cape wrote:
On Mon, 2002-06-17 at 18:36, William L. Thomson Jr. wrote:
I am trying to make a form look pretty. :)

I am coming from a Java background, and in Java I used a gridbaglayout
with various constraints.

With GTK+ I am not sure what to use. I am using GTK+1.2, and using the
vbox and hbox to control layout. I am thinking about experimenting with
the a table?

Or should I just stick with the vbox, and hbox, and do my best with
them?

I have gotten close to what I am looking for, but not exactly.

Any suggestions or recommendations?

I like GTK allot. I just started with C/C++ a week or two ago, and
quickly made progress into gui's.

It was easier to decide what gui library to use, than deciding C or C++.

I'm unfamiliar with Java,

Java just has layout mangers that layout things in different way. Some
like flowlayout,cardlayout,gridlayout, and my favorite gridbaglayout are
all pretty basic and straight forward.

though I am reasonably familiar with GTK+'s
layout. Sooo, if you want something like this (warning, ascii art :-)):

How else can you express visual ideas with text? ascii art is fine. :)

Some text:       [__________________]
Some more stuff: [__________________]
Some pulldown:   [ Current Val | ^v ]
[x] Some checkbutton

You'd want to use a GtkTable.

Yes, it looks like I do need to play around with the table. I can get
close but not perfect with the vbox, and hbox.

If you want something like this:

[Button1][Button2][Button3][Button4]
[Button5][Button6]

That wraps around based on window width (so, if the user shrinks the
window width, it would look like):

[Button1][Button2][Button3]
[Button4][Button5][Button6]

Yes this I would like to avoid. If my windows are resized, I think I can
turn that off, I do want everything to stay put. Hopefully with fixed
sizes.

Then you'd want to use a GtkHWrapBox (GIMP has the source for this
widget, though it is unfortunately not included in GTK+ yet -- so if
you're writing a GPL'd application you can just grab gtkhwrapbox.{c,h}
and it's dependencies [gtkwrapbox.{c,h}]).

I am trying to stick with the core components at the moment.

GTK+ 2.0 also includes the "GtkSizeGroup", which makes doing stuff like
this a snap:

I really wish I could use GTK+ 2.0, but I have a pathetic reason why I
can't at the moment. I have a theme I love that will not work with 2.0
:)

Even more pathetic its the Aqua theme, so my Gnome look is basically the
same a the new OS10 from Apple. Of course I do not have all the cool
animations and etc. But I also run a free OS, so... :)

+-Some GtkFrame-----------------------+
| Some text:     [__________________] |
| Some pulldown: [ Current Val | ^v ] |
+-------------------------------------+

+-Some Other GtkFrame-----------------+
| Stuff:         [__________________] |
| [x] Some checkbutton                |
+-------------------------------------+

Because you can just create a pair of GtkSizeGroups and add all your
labels to one, and your entries to another, (after they're in GtkTables
or GtkVBoxes/GtkHBoxes) and they will always maintain the same (width
&/or height, depending on what you set). Hope that helps.

In every language there is allot of crap required just to position
things. Why can't I just specify x and y coordinates. :(

Also, the HIG has some (somewhat confusing) rules on spacing for GNOME
apps, so they maintain a basically similar look.

http://developer.gnome.org/projects/gup/hig/draft_hig/

Thanks, nice to try and conform to the standard. :) Although it's an
internal app, so I am not to sure how much that matters. Good to know
though.

Bottom line I have to do allot of trial and error, and widget fidget. :)
The annoying part of gui development.

Peace,

    Jim Cape
    http://ignore-your.tv/

    "No cause, no God, no abstract idea can justify the mass
     slaughter of innocents."
        -- Edward Said

--
Sincerely,
William L. Thomson Jr.
Support Group
Obsidian-Studios Inc.
439 Amber Way
Petaluma, Ca. 94952
Phone  707.766.9509
Fax    707.766.8989
http://www.obsidian-studios.com

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



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