Re: scrolledview



On Thu, 2007-02-08 at 05:53 +0000, tomas tuxteam de wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Feb 07, 2007 at 08:32:26PM +0100, Mehmet YASAR wrote:
tomas tuxteam de a Ãcrit :
[...]
how can I know that all the widget have done their size negotiations ?
I can't rely on the "realized" signal since the gtkvbox is already realized ...

I'd put my bets on the widget's size-allocate signal -- but I don't know
for sure.

I had already done some experimentation and I've found that widgets may 
get more than one size-allocate signal.

[...]

Yes, I suppose you'd have to "track" the size as it changes. If you have
to do an action  hwenever the size really, truly changed (meaning it has
been displayed and all is quiescent), perhaps an idle handler would be
the right place.

Regards
- -- tomÃs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFFyrrRBcgs9XrR2kYRAv5IAJ492lpDlVYRLNQMTW5tyQg7tyzCtQCfdpVr
CbfgmDGn4JNUmPkHHam9lZI=
=UcZq
-----END PGP SIGNATURE-----


Mehmet,

An idle handler would be a good fit here.  I assumed that you are
creating and filling textviews during the startup of your program and
possibly before you enter the main_loop or gtk_main.  Or possibly in a
routine that does everything at once.  Here is the potential problem:
your create and populate actions require some additional gtk messages to
be processed, which are waiting to get serviced by the gtk_main() loop.
So thing s will not appear to settle down until after the gtk_main has
been allowed to run.  Using an idle handler puts your call to a
Position/Size routine at the back of the waiting queue of needed
messages, so by the time it's processed the other messages have done
their job and all the textviews/scrollbars/gtkvboxes, and scrolled
windows have settled down.  -- wait, this assumes you issued a
gtk_widget_show{_all} on the main window containing all this stuff!  Its
the gtk_widget_show that starts the cascade of messages which includes
the size and realize messages.  

g_idle_add() or g_timeout_add(250,...) show do the trick.

James,



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

James Scott, Jr.                                                 
Registered Linux User #270764
FC6 on Dual AMD-MP 2400+
Author: {gfhcm, gkrellfah2,gapcmon,giw}.sourceforge.net
http://mysite.verizon.net/skoona/index.html


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