Re: [fxruby-users] dynamically resizing a window

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: [fxruby-users] dynamically resizing a window

by Jeroen van der Zijp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tuesday 15 September 2009, Eric Hutton wrote:
> Is there a way to dynamically resize a window in response to dynamically
> added content?
>
> Take the "dynamic.rb" example from Lyle's Create Lean and Mean GUIs book,
> after hitting the add row button a number of times, the added rows extend
> beyond the bottom of the window.  Is there a way to get the window to try
> and resize itself according to the dynamically added content?  I messed
> around with .layout and .repaint, but to no effect.

The steps should be roughly as follows:


        1) change the contents of the window (dialog box or toplevel window).

        2) compute the new size, based on layout parameters and sizes of the
           widgets; use the topwindow's getDefaultWidth() and getDefaultHeight()
           See footnote.

        3) Change the toplevel window's size according to the values computed
           in step 2, calling resize() on the topwindow.  Note, the borders will
           be added by the interface between FOX and your windowmanager.


The resize() will lead to a new call to layout(), since the window will have changed
size.  This will also result in a bunch of repaint messages which your program must
be allowed to handle before the window will be properly drawn to the screen.


Hope this helps,


                        - Jeroen


Footnote: the size computed by getDefaultWidth() and getDefaultHeight() will be the
minimum fit of the window around its contents.

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

Parent Message unknown Re: [fxruby-users] dynamically resizing a window

by Jeroen van der Zijp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 16 September 2009, Muita Wangoko wrote:
> Hi Jeroen,
>
> Thank you for the this great tool you created.
>
> I have been using and managed to tweak some fews things here and there in
> the ccl timer but I would like you to please help me out.
>
> How can I block another user from starting the a new session from  a client
> before the previous version is cashed or logs cancelled?

You need to somehow find out if another copy of your program is running already
or not.

There are many ways to do that.  One simple way is to create a small file on
the filesystem, like:

        $HOME/.program_already_running

Perhaps record process ID in it or so.  When the program ends just remove the
file.

There are other ways too; it just depends on how much work you're willing to do, and
if you just want to see if another copy is (still/already) running or if you actually
want to communicate with it in some way.  Like starting a 2nd browser with a different
url will not start a 2nd copy of the executable, but just cause an already running
program to open a new tab, for instance...


                - Jeroen


P.S.

The FOX Toolkit website is down, but work is in progress to get everything back
up.  Hopefully we'll be back within a week or so....

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users