WebGadget: Directly insert code and catch link clicks.

Share your advanced PureBasic knowledge/code with the community.
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

freak wrote:I plan to put all this code together into a library ...
I think that will be a big hit.

freak wrote:... but right now i just do not have the time.
I wonder why? ;) :)
@}--`--,-- A rose by any other name ..
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

I have put an updated version of the includefile that should work with PB4 beta9 at the
original location here:

http://freak.purearea.net/code/WebGadgetExtras.pb

Tell me if there are any problems.
quidquid Latine dictum sit altum videtur
Dummy
Enthusiast
Enthusiast
Posts: 162
Joined: Wed Jun 09, 2004 11:10 am
Location: Germany
Contact:

Post by Dummy »

this html code is not handeled correctly by link callback:

Code: Select all

<a href="page.htm"><img src="img.jpg"></a>
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Dummy wrote:this html code is not handeled correctly by link callback:

Code: Select all

<a href="page.htm"><img src="img.jpg"></a>
A new version is uploaded.. should work now.
quidquid Latine dictum sit altum videtur
real
User
User
Posts: 49
Joined: Fri Oct 08, 2004 5:17 am

Post by real »

@Freak:
Could you please give me the version for PB 3.94? I'm writing a tool which needs it - and PB 4 is not ready yet to be the compiler for that tool. :cry:
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Sorry, i modified my sources for the v4 version, i do not have a 3.94 compatible one anymore.
Maybe somebody else still has the 3.94 version ?
quidquid Latine dictum sit altum videtur
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

yes i have if you need - nearly october 2005 old.
http://www.penguinbyte.com/apps/pbwebst ... _pb394.zip
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
real
User
User
Posts: 49
Joined: Fri Oct 08, 2004 5:17 am

Post by real »

Big thanks!!! :)
Lyon
User
User
Posts: 59
Joined: Tue Mar 28, 2006 9:26 pm

Post by Lyon »

I still have the 3.94 version too is somebody needs it.

I wish people would use some common sense and keep 3.94 versions of their libs, etc around and not just delete them and post 4.0 versions. Especially with PB where each new release breaks existing code, this is even more crucial.
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

This is weird, cause this won't work!

Well it does if i load it before the callback, but if i call inside the web_callback, to catch special links it doesn't ...

Code: Select all

Procedure LoadHTM(FileName$)
  FileName$=OpenFileRequester("Select a file","","Html|*.htm,*.html",0)
  If OpenFile(0,FileName$)
    If WebGadget_Open(#WebGadget, 0) 
      Repeat
        string.s=ReadString(0)
        WebGadget_Write(string.s+Chr(10))
      Until Eof(0)
      WebGadget_Close()
    EndIf
  EndIf
  
EndProcedure
It always makes a white webpage, even the code is there!
glubschi90
New User
New User
Posts: 1
Joined: Sun Oct 09, 2005 7:12 pm
Location: Germany
Contact:

Post by glubschi90 »

Works just fine on my PC but I've got one problem: If I use the Open, Write and Close-procedure inside a thread it doesn't work....

Example:

Code: Select all

id=OpenWindow(0,0,0,400,400,"Test",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)

CreateGadgetList(id)
WebGadget(0,0,0,400,400,"")

Procedure TestThread()
  
  Delay(3000)
  WebGadget_Open(0,0)
  WebGadget_Write("Test123")
  WebGadget_Close()
  
EndProcedure

CreateThread(@TestThread(),0)

Repeat:Until WaitWindowEvent()=#PB_Event_CloseWindow
Chris :)
Beach
Enthusiast
Enthusiast
Posts: 677
Joined: Mon Feb 02, 2004 3:16 am
Location: Beyond the sun...

Post by Beach »

Flype wrote:yes i have if you need - nearly october 2005 old.
http://www.penguinbyte.com/apps/pbwebst ... _pb394.zip
I get a "Structure not found: IID" when I try to use the include above with PB 3.94. Flype (anyone), are you able to use the include file that is linked above in 3.94?

Also, thanks for including the 'WebGadgetJS.pb' file with the 'WebGadgetExtras.pb' file. I hope to use both of them.
-Beach
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

yes you're right.

So i've updated the archive including the missing stuff :

1/ Structure IID
2/ Label IID_IUnknown:

http://www.penguinbyte.com/apps/pbwebst ... _pb394.zip
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Beach
Enthusiast
Enthusiast
Posts: 677
Joined: Mon Feb 02, 2004 3:16 am
Location: Beyond the sun...

Post by Beach »

I'm still getting the same error. I do not see a structure for IID, in fact, WebGadgetsExtras.pb does not look like it has been altered at all. Can you confirm the archive listed has the added structure?

Man, I'm feeling like a dork here...
-Beach
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

IID is just another name for the GUID structure. just write

Code: Select all

Structure IID Extends GUID: EndStructure
quidquid Latine dictum sit altum videtur
Post Reply