[Gambas-user] Re: Overload the form close?

Andre Saccomani andre.gambas at ...626...
Mon Nov 14 21:55:52 CET 2005


Thanks Benoit, It worked perfectly.

Now going off-topic. can you help me on more time? More difficult this time.

I dont want to allow two instances of my program running at the same time.
So I want to check if my program is already running. If so, I do not want to
allow a second instance. This part is easy to be achieved, so let me move
forward:
Is there anyway to send a signal to a linux PID? and if so, is there a way
to catch these signals in a gambas application? So when I try to open a
second instance of my program, it would check if is there one already
running and then it could send a signal to the first instance before exit.
This signal would cause my program (the first instance) do do a dlgMain.Show,
or something like this. restoring it from tray.

I'm not sure if this is possible using gambas, but if possible, can you give
a tip of how to achieve that?

Thanks in advance,
Andre


On 11/14/05, Benoit Minisini <gambas at ...1...> wrote:
>
> On Monday 14 November 2005 19:35, Andre Saccomani wrote:
> > I could workaround the minimize problem by using the form_deactivate
> > function. I have put a MainDlg.Hide into it, and that solved the
> minimize
> > problems. However, I couldn't find anything to put in the form_close
> that
> > could make it change its behavior. Does anybody knows how to deal with
> the
> > form_close?
> >
> > Andre
> >
> > On 11/14/05, Andre Saccomani <andre.gambas at ...626...> wrote:
> > > Hi,
> > >
> > > I'm making a simple software to my father that will allow him to
> > > estabilish/drop his PPPoE connection. I'm making a program that lays
> on
> > > the KDE tray bar. when he double click the tray icon, a dialog box
> > > apears. By default the box have the regular minimize/close buttons on
> the
> > > upper right corner. that is where my problems are. I want to change
> the
> > > minimize/close buttons behavior. I want that both do the exactly same
> > > thing, that is: Minimize the program back to tray, without closing it.
> I
> > > want that the only way to close the program be trough a righ
> click/exit
> > > over the tray icon.
> > > so...
> > > Is therer anyhow to change the minimize/close buttons behavior? make
> them
> > > minimize my program to tray instead of closing it? It would be very
> > > usefull to prevent an undesired close.
> > >
> > >
> > > Thanks,
> > > Andre Silveira
>
> Did you try to cancel the form_close event, and to minimize the window in
> it ?
>
> --
> Benoit Minisini
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server.
> Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20051114/50c54ca7/attachment.html>


More information about the User mailing list