[Gambas-user] RE: Gambas-user digest, Vol 1 #1616 - 5 msgs

James Wilson JamesWilson at ...1288...
Fri Dec 23 11:19:42 CET 2005


On Thu December 22 2005 17:03, James Wilson wrote:
> I cant seem to replicate this in gambas, I need to be able to
> pull a jpg from a streaming server that gives out jpg's on
> request depending upon the command line used. The only reason
> I mention the streaming thing is because its not an actual jpg
> file with a jpg file extension but it is a jpeg. Anyone got
> any clues

I'd use the gb.net.curl class to retrieve the image to /tmp and 
then load it into the picturebox.  Gambas doesn't care what the 
file extension is... you can name the output file whatever you 
want.

Rob

Thanks Rob but ideally I want to get a new image between 0.1 and 0.5 seconds. I’m assuming this freq and writing files to disk this often wouldn't be great, but I havnt tried it. In vs its all done in ram and I don’t need to cache anything, was hoping I’d missed a command that’s all

Cheers

James



-----Unmodified Original Message-----
Send Gambas-user mailing list submissions to
	gambas-user at lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
	https://lists.sourceforge.net/lists/listinfo/gambas-user
or, via email, send a message with subject or body 'help' to
	gambas-user-request at lists.sourceforge.net

You can reach the person managing the list at
	gambas-user-admin at lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Gambas-user digest..."


Today's Topics:

   1. Can Gambas run itself? (Kchula-Rrit)
   2. Re: Killing objects? Urgent (Eilert)
   3. Image from url (James Wilson)
   4. Re: Image from url (Rob Kudla)
   5. Re: Can Gambas run itself? (Benoit Minisini)

--__--__--

Message: 1
From: Kchula-Rrit <kchularrit at ...734...>
To: gambas-user at lists.sourceforge.net
Date: Wed, 21 Dec 2005 23:55:03 -0800
Subject: [Gambas-user] Can Gambas run itself?
Reply-To: gambas-user at lists.sourceforge.net


	I'm trying to get a Gambas2 program to run another copy of itself but am 
having problems.  I'm trying to have the main program send commands into a 
file, which the second program reads with a "tail -f" command.  The main 
program receives command-responses with its own "tail -f" command.  It's sort 
of like the following:

     ' Create log file.
     Open MainLogFileName FOR CREATE AS #MainLogFile
     . Run second program...
     Second2Main = SHELL "gbx2 secondprog" FOR READ WRITE
     ' Create communication file.  secondprog reads its commands from this.
     Open Main2SecondCommFileName FOR CREATE AS #Main2SecondCommFile
           ...
     ' These four statements wait for secondprog to create its file.
     IF EXIST (Second2MainCommFileName) = FALSE THEN
          WAIT (1.0)     ' Wait for secondprog to create its comm file.
     ENDIF
     WAIT (1.0)
     ' secondprog has created its file.  continue...
     #GetResponses = SHELL "tail -f Second2MainCommFileName" FOR READ WRITE

          ...
     Process_Read()

     secondprog does something similar:

     ' Create log file.
     Open SecondLogFileName FOR CREATE AS #SecondLogFile
     ' Create communication file.  mainprog reads command-results from this.
     Open Second2MainCommFileName FOR CREATE AS #Second2MainCommFile
           ...
     ' These four statements wait for mainprog to create its file.
     IF EXIST (Main2SecondCommFileName) = FALSE THEN
          WAIT (1.0)     ' Wait for mainprog to create its comm file.
     ENDIF
     WAIT (1.0)
     ' mainprog has created its file.  continue...
     #GetResponses = SHELL "tail -f Main2SecondCommFileName" FOR READ WRITE

          ...
     Process_Read()



     I send commands from mainprog to secondprog by PRINTing to the 
Main2SecondCommFile.  secondprog sends responses by PRINTing to the 
Second2MainCommFile.

     The problem is that the second program appears to receive the commands 
and do them, but nothing is sent to the file that the main program checks for 
return data.

     Any Ideas?

K-R


--__--__--

Message: 2
Date: Thu, 22 Dec 2005 11:22:51 +0100
From: Eilert <eilert-sprachen at ...221...>
Organization: Sprachschule Eilert
To:  gambas-user at lists.sourceforge.net
Subject: Re: [Gambas-user] Killing objects? Urgent
Reply-To: gambas-user at lists.sourceforge.net

Benoit Minisini schrieb:

>On Wednesday 21 December 2005 18:13, Eilert wrote:
>  
>
>>Benoit Minisini schrieb:
>>    
>>
>>>On Wednesday 21 December 2005 13:22, Eilert wrote:
>>>      
>>>
>>>>Benoit Minisini schrieb:
>>>>        
>>>>
>>>>>On Wednesday 21 December 2005 10:01, Eilert wrote:
>>>>>          
>>>>>
>>>>>>I think I've got it. This way, it uses the .Delete method of the
>>>>>>TextBoxes themselves. Only after that, the array is cleared:
>>>>>>
>>>>>>  FOR i = mTxt.Count - 1 TO 0 STEP -1
>>>>>>    mTxt[i].Delete
>>>>>>  NEXT
>>>>>>  mTxt.Clear
>>>>>>
>>>>>>This seems to do what I wanted - is it correct, or will it crash one
>>>>>>day?
>>>>>>
>>>>>>Rolf
>>>>>>            
>>>>>>
>>>>>Clear() only clears the text inside the textbox. It is equivalent to do
>>>>>mTxt.Text = ""
>>>>>
>>>>>But Delete() effectively destroys the control.
>>>>>
>>>>>Wasn't the documentation clear ?
>>>>>
>>>>>Regards,
>>>>>          
>>>>>
>>>>The documentation was clear, but I couldn't find how to kill the single
>>>>controls.
>>>>
>>>>What I tried first was just mTxt.Clear, which should clear the array but
>>>>did not kill the controls. But I didn't try mTxt[i].Clear as I clearly
>>>>saw the difference :-)
>>>>
>>>>So, is it ok the way it's shown above?
>>>>
>>>>Rolf
>>>>        
>>>>
>>>Yes!
>>>      
>>>
>>Ok, good to know :-)
>>
>>The question now is: How do I catch events from these controls?
>>    
>>
>
>mTxt[i] = NEW TextBox(Maske) AS "NameOfTheEventHandler"
>
>Read the documentation about NEW on the wiki if you want more details...
>
>Regards,
>
>  
>
Aaaah, c'est LAST n'est-ce pas? C'est genial! Merci!

Rolf



--__--__--

Message: 3
Date: Thu, 22 Dec 2005 22:03:48 -0000
From: "James Wilson" <JamesWilson at ...1288...>
To: <gambas-user at lists.sourceforge.net>
Subject: [Gambas-user] Image from url
Reply-To: gambas-user at lists.sourceforge.net

This is a multi-part message in MIME format.

------_=_NextPart_001_01C60743.EF28EE2B
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

Im trying to replace my vs. net with gambas mainly because I want to
create some small apps to run on Linux.

I have played with gambas stable and everything is grand but
In vb.net I can tell a picturebox to get an image from a url, using a
setting called imagelocation.
I cant seem to replicate this in gambas, I need to be able to pull a jpg
from a streaming server that gives out jpg's on request depending upon
the command line used. The only reason I mention the streaming thing is
because its not an actual jpg file with a jpg file extension but it is a
jpeg. Anyone got any clues

Cheers

James
PS Happy xmas etc

------_=_NextPart_001_01C60743.EF28EE2B
Content-Type: text/html;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.5.7233.28">
<TITLE>Image from url</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=3D2 FACE=3D"Arial">Im trying to replace my vs. net with =
gambas mainly because I want to create some small apps to run on =
Linux.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">I have played with gambas stable and =
everything is grand but</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">In vb.net I can tell a picturebox to =
get an image from a url, using a setting called imagelocation.</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">I cant seem to replicate this in =
gambas, I need to be able to pull a jpg from a streaming server that =
gives out jpg's on request depending upon the command line used. The =
only reason I mention the streaming thing is because its not an actual =
jpg file with a jpg file extension but it is a jpeg. Anyone got any =
clues</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Cheers</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">James</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">PS Happy xmas etc</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C60743.EF28EE2B--


--__--__--

Message: 4
From: Rob Kudla <sourceforge-raindog2 at ...94...>
To: gambas-user at lists.sourceforge.net
Subject: Re: [Gambas-user] Image from url
Date: Thu, 22 Dec 2005 17:23:07 -0500
Reply-To: gambas-user at lists.sourceforge.net

On Thu December 22 2005 17:03, James Wilson wrote:
> I cant seem to replicate this in gambas, I need to be able to
> pull a jpg from a streaming server that gives out jpg's on
> request depending upon the command line used. The only reason
> I mention the streaming thing is because its not an actual jpg
> file with a jpg file extension but it is a jpeg. Anyone got
> any clues

I'd use the gb.net.curl class to retrieve the image to /tmp and 
then load it into the picturebox.  Gambas doesn't care what the 
file extension is... you can name the output file whatever you 
want.

Rob


--__--__--

Message: 5
From: Benoit Minisini <gambas at ...1...>
To: gambas-user at lists.sourceforge.net
Subject: Re: [Gambas-user] Can Gambas run itself?
Date: Fri, 23 Dec 2005 01:13:06 +0100
Reply-To: gambas-user at lists.sourceforge.net

On Thursday 22 December 2005 08:55, Kchula-Rrit wrote:
> 	I'm trying to get a Gambas2 program to run another copy of itself but am
> having problems.  I'm trying to have the main program send commands into a
> file, which the second program reads with a "tail -f" command.  The main
> program receives command-responses with its own "tail -f" command.  It's
> sort of like the following:
>
>      ' Create log file.
>      Open MainLogFileName FOR CREATE AS #MainLogFile
>      . Run second program...
>      Second2Main = SHELL "gbx2 secondprog" FOR READ WRITE
>      ' Create communication file.  secondprog reads its commands from this.
>      Open Main2SecondCommFileName FOR CREATE AS #Main2SecondCommFile
>            ...
>      ' These four statements wait for secondprog to create its file.
>      IF EXIST (Second2MainCommFileName) = FALSE THEN
>           WAIT (1.0)     ' Wait for secondprog to create its comm file.
>      ENDIF
>      WAIT (1.0)
>      ' secondprog has created its file.  continue...
>      #GetResponses = SHELL "tail -f Second2MainCommFileName" FOR READ WRITE
>
>           ...
>      Process_Read()
>
>      secondprog does something similar:
>
>      ' Create log file.
>      Open SecondLogFileName FOR CREATE AS #SecondLogFile
>      ' Create communication file.  mainprog reads command-results from
> this. Open Second2MainCommFileName FOR CREATE AS #Second2MainCommFile ...
>      ' These four statements wait for mainprog to create its file.
>      IF EXIST (Main2SecondCommFileName) = FALSE THEN
>           WAIT (1.0)     ' Wait for mainprog to create its comm file.
>      ENDIF
>      WAIT (1.0)
>      ' mainprog has created its file.  continue...
>      #GetResponses = SHELL "tail -f Main2SecondCommFileName" FOR READ WRITE
>
>           ...
>      Process_Read()
>
>
>
>      I send commands from mainprog to secondprog by PRINTing to the
> Main2SecondCommFile.  secondprog sends responses by PRINTing to the
> Second2MainCommFile.
>
>      The problem is that the second program appears to receive the commands
> and do them, but nothing is sent to the file that the main program checks
> for return data.
>
>      Any Ideas?
>
> K-R
>

When you open a file, by default input/output are buffered.

Try to use the FLUSH instruction after PRINT, or adds the WRITE keyword before 
CREATE to your OPEN statements.

Regards,

-- 
Benoit Minisini




--__--__--

_______________________________________________
Gambas-user mailing list
Gambas-user at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


End of Gambas-user Digest




More information about the User mailing list