Hi,

your code brought me to try AG_WindowSetGeometry with x, y, w and h =
-1. It works, but only if the window has been drawn since the widgets
updated in size.

As an example I set a label text with AG_LabelString to something long
(multiple lines) and called AG_WindowSetGeometry afterwards: didn't
work, label text is truncated. Calling AG_WindowSetGeometry on that
window in the event loop after the next AG_WindowDraw of that window
works, the window grows and the label text is no longer truncated.

This little trick does it but it would be interesting to know what
could be done instead adding facilities to the event loop to autosize
windows that "request" it.

2010/3/12 Olexandr Sydorchuk <[email protected]>:
>
> I think it not good sample but I use is to reset size of window in my
> main menu "show some window" event:
>
> --8<---------------cut here---------------start------------->8---
>                AGWIDGET(win)->x = -1;
>                AGWIDGET(win)->y = -1;
>                AG_WindowSetPosition(win, AG_WINDOW_TC, 0);
>                AG_WindowShow(win);
> --8<---------------cut here---------------end--------------->8---
>
> Jakob Reschke <[email protected]> writes:
>
>> Is there a way to have the window automatically resized as if it was
>> shown for the first time again?
_______________________________________________
Agar mailing list
[email protected]
http://libagar.org/lists.html

Reply via email to