WebGadget: How to use???
-
bender-rulez
- User

- Posts: 49
- Joined: Mon Mar 14, 2005 11:30 am
WebGadget: How to use???
Hi,
I have read that in PB 3.93 the Webgadget should work, but how to use it, what about the link to libgtkembedmoz.so had to be done??
I really need it, cause I want to use XUL with PB!
Thanks
I have read that in PB 3.93 the Webgadget should work, but how to use it, what about the link to libgtkembedmoz.so had to be done??
I really need it, cause I want to use XUL with PB!
Thanks
Some tried and got it working, some other not, so it's not easy to use it. Be sure you have the .so file on your pc, and if yes you can do a symbolic link (ln -s) in your lib directory and run ldconfig. If all goes well, the webgadget() will be created. Be sure to pass an URL in the WebGadget() call as there was a little bug with SetGadgetText(). It does need GTK2 too, so ensure than -s gtk2 compiler switch is activated.
-
bender-rulez
- User

- Posts: 49
- Joined: Mon Mar 14, 2005 11:30 am
WebGadget: How to use???
So, I have done it that way, it compiles without any error:
but when I start the programm the window seems to be empty?
I have 'libgtkembedmoz.so' from a Mozilla installation linked to /usr/lib/libgtkembedmoz.so and I used the -s gtk2 option for the compiler!
Any hints?
Code: Select all
If OpenWindow(0,0,0,600,300,#PB_Window_SystemMenu,"WebGadget") And CreateGadgetList(WindowID(0))
WebGadget(0,10,10,580,280,"http://www.purebasic.com")
; Note: if you want to use a local file, change last parameter to "file://" + path + filename
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf
I have 'libgtkembedmoz.so' from a Mozilla installation linked to /usr/lib/libgtkembedmoz.so and I used the -s gtk2 option for the compiler!
Any hints?
-
bender-rulez
- User

- Posts: 49
- Joined: Mon Mar 14, 2005 11:30 am
Webgadget
Yes, that makes sense! It is '0'!
Whats now? How to find out why it is not created?
Is there any way to debug it?
Whats now? How to find out why it is not created?
Is there any way to debug it?
-
olejr
- Enthusiast

- Posts: 152
- Joined: Sun Jul 11, 2004 7:48 pm
- Location: Lillehammer, No(r)way
- Contact:
What distro are you running??
Anyway. Here's how i got it working on Mandrake 10.1:
I take it you have created the link in /usr/lib/ already..
(Seems like this isn't always enough...)
Do the following as root:
Add '/path-to-libgtkembedmoz.so to /etc/ld.so.conf
On mdk this is: /usr/lib/mozilla-1.7.2
Then do a ldconfig
Should say that after i did this i also found out that
you can create a file in /etc/ld.so.conf.d (if that folder exist)
named somefile.conf (just the .conf part i important)
And add the path to the lib into that file..
Then do ldconfig..
Anyway. Here's how i got it working on Mandrake 10.1:
I take it you have created the link in /usr/lib/ already..
(Seems like this isn't always enough...)
Do the following as root:
Add '/path-to-libgtkembedmoz.so to /etc/ld.so.conf
On mdk this is: /usr/lib/mozilla-1.7.2
Then do a ldconfig
Should say that after i did this i also found out that
you can create a file in /etc/ld.so.conf.d (if that folder exist)
named somefile.conf (just the .conf part i important)
And add the path to the lib into that file..
Then do ldconfig..
Last edited by olejr on Tue Mar 15, 2005 12:53 pm, edited 2 times in total.
-
bender-rulez
- User

- Posts: 49
- Joined: Mon Mar 14, 2005 11:30 am
Webgadget
I have done now done the entry in ld.so.conf
'/opt/mozilla/lib' running SuSE 9.1
On SuSE 9.1 there is no dir '/etc/ld.so.conf.d'
therefore I dont maked an entry in some.conf
I also need to do 'export PKG_CONFIG_PATH=/opt/gnome/lib/pkgconfig'
to find the gtk2 libs when compiling
when I start the compiled programm
the result of the return value of WebGadget is: 134787096
????
The MessageRequester appears after taking a lot CPU time!
'/opt/mozilla/lib' running SuSE 9.1
On SuSE 9.1 there is no dir '/etc/ld.so.conf.d'
therefore I dont maked an entry in some.conf
I also need to do 'export PKG_CONFIG_PATH=/opt/gnome/lib/pkgconfig'
to find the gtk2 libs when compiling
when I start the compiled programm
Code: Select all
If OpenWindow(0,0,0,600,300,#PB_Window_SystemMenu,"WebGadget") And CreateGadgetList(WindowID(0))
test = WebGadget(0,10,10,580,280,"http://www.purebasic.com")
; Note: if you want to use a local file, change last parameter to "file://" + path + filename
Ergebnis$ = Str(test)
MessageRequester ("Information",Ergebnis$,0)
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf
????
The MessageRequester appears after taking a lot CPU time!
-
bender-rulez
- User

- Posts: 49
- Joined: Mon Mar 14, 2005 11:30 am
Webgadget
The Return value changed to: 134787024
?
?
-
bender-rulez
- User

- Posts: 49
- Joined: Mon Mar 14, 2005 11:30 am
Webgadget
Yes, the cpu time is idle after the messagerequester!
No, it doesn't display anything!
No, it doesn't display anything!
-
olejr
- Enthusiast

- Posts: 152
- Joined: Sun Jul 11, 2004 7:48 pm
- Location: Lillehammer, No(r)way
- Contact:
Hm... Try this:
Code: Select all
If OpenWindow(0,0,0,600,300,#PB_Window_SystemMenu,"WebGadget") And CreateGadgetList(WindowID(0))
test = WebGadget(0,10,10,580,280,"http://www.purebasic.com")
; Note: if you want to use a local file, change last parameter to "file://" + path + filename
SetGadgetText(0, "http://www.purebasic.com") ; <- Add this line to your code
Ergebnis$ = Str(test)
MessageRequester ("Information",Ergebnis$,0)
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf-
bender-rulez
- User

- Posts: 49
- Joined: Mon Mar 14, 2005 11:30 am
Webgadget WORKS!!!
YES!!! You are the man! It works very well!!!

Now I can make my integrated Socket SQLite XUL Rendering Programm!

one question! will it be possible to use the mozilla lib on windows too??
instead the internet explorer?
would be cool!
Now I can make my integrated Socket SQLite XUL Rendering Programm!
one question! will it be possible to use the mozilla lib on windows too??
instead the internet explorer?
would be cool!
-
olejr
- Enthusiast

- Posts: 152
- Joined: Sun Jul 11, 2004 7:48 pm
- Location: Lillehammer, No(r)way
- Contact:
Just remembered that the bug is that the WebGadget didn't take the url passed to it..
There's plenty of bugfixes for PureBasic Linux at:
http://www.purebasic.com/beta/linux
Everything in the gtk2 folder goes into /path-to-pb-install/purebasic/subsystems/gtk2/purelibraries/
Just don't install the gtkbase library that is there.. I think that has some thread spesific things in it.
And the rest to: /path-to-pb-install/purebasic/purelibraries/
(The copy must be done as root..)
And no, the Mozilla is Linux only..
Oh.. and there isn't long before v3.93b i think..
@Fred: A little update on how to make this work.. If done as I described, there's no need for the symbolic-link..
