[Gambas-user] "mutex" applications

nando nando_f at ...951...
Thu Jun 7 03:49:29 CEST 2012


I'd like to suggest a form property called 'Singleton'
when _new or _init is called (whichever creates the object)
then it will not create a second and only
return the first instance of it.  Somewhat like a module.


---------- Original Message -----------
From: Benoît Minisini <gambas at ...1...>
To: mailing list for gambas users <gambas-user at lists.sourceforge.net>
Sent: Wed, 06 Jun 2012 19:05:31 +0200
Subject: Re: [Gambas-user] "mutex" applications

> Le 06/06/2012 14:32, tobi a écrit :
> > On Wed, 06 Jun 2012, Bruce wrote:
> >> On Wed, 2012-06-06 at 12:38 +0200, Rolf-Werner Eilert wrote:
> >>
> >>> Hi Bruce,
> >>>
> >>> I have successfully used this code which is from Jussi Lahtinen. I built
> >>> it into two of my applications, and it works reliably, at least under
> >>> Gambas2 on our somewhat older system:
> >>>
> >>> PUBLIC SUB Form_Open()
> >>> DIM sOutput AS String
> >>>
> >>>     EXEC ["pgrep", "-f", "-l", "-u", System.User.Name, "Stein3.gambas"]
> >>> WAIT TO sOutput
> >>>
> >>>     IF Split(Trim$(sOutput), gb.NewLine).Count>  1 THEN
> >>>       QUIT
> >>>     ENDIF
> >>>
> >>> Just replace "Stein3" by your binary's name.
> >>>
> >>> Regards
> >>>
> >>> Rolf
> >>
> >>
> >> Nice! A lot quicker than using gb.Desktop.
> >>
> >>
> >> Sadly!
> >> It doesn't solve the problem of activating the desired window.
> >>
> >> And there is a slight "weird", it doesn't detect an instance that is
> >> running via the IDE.  No idea, but don't really care much, that's not
> >> the problem.
> >>
> >> Ah well, back to Benoit's dbus suggestion.  Oh, how I hate having to
> >> learn these "new" techo things.
> >>
> >> Back tomorrow.
> >>
> >> regards
> >> Bruce
> 
> The good solution is using D-Bus. It is not very difficult actually.
> 
> As soon as I have time I will try to make a Gambas function in the 
> gb.dbus component so that you can create "unique" application as simply 
> as possible.
> 
> Regards,
> 
> -- 
> Benoît Minisini
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
------- End of Original Message -------





More information about the User mailing list