Re: gtktable question



I'm not familiar with a GtkTable, but
a a GtkTable is an implementation of
GtkContainer. so:

GTK_CONTAINER(table)->remove(GTK_CONTAINER(table), child_widget);

should be more apropriate than removeing it by hand
from the GList.

(this would be the equivalent of calling:
"gtk_container_remove(GTK_CONTAINER(table), child_widget);"
because container will call the objects implementation of "remove")

NOTE:
remember that if the container didn't create the widget;
removing it will not bring the reference count to 0; so that
widget will not be finalized. (you can still use a widget that
has been added/ref'd --> removed/unref'd)


also you might want to check what happens when you call
gtk_container_add(GTK_CONTAINER(table), child_widget);

and check the "GtkContainer" documentation for more funky
stuff that "containers" implement ... such as:

gtk_container_resize_children()
gtk_container_forall()
etc etc...

=========================

if you really need to "manhandle" the widget you might try

gtk_widget_queue_draw(GTK_WIDGET(table));

at the end and let the event loop do its thing
        _or_
copy the source of the GtkTable in order to make one
that does what you want.

But I really doubt that a widget as seemingly generic
as the table doesn't support at least 
removing / repositioning / resizing.


        -Tristan

yanxin wrote:

(I posted this question while back and got no answer, now repost)

Supose I have a 3x3 gtktable with wdgets attached in. Later on, I want
to resize
or reposition the widgets(cell) to use different attach
parameters(left_attach,right_attach,top_attach,bottom_attach). How can I

do this?

I have thought of two methods:
method 1. unparent the widget attached, remove the child from the
gtktable->children, then re-attach the widget with the new parameters;

method 2.modify the parameters in gtktablechild->left_attach(and also
right_attach, top_attach,bottom_attach), then what should I do next?

Will those ideas work? Please help!

Regards

Yanxin

_______________________________________________
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]