added eugtk examples
This commit is contained in:
49
eugtk/examples/test85.ex
Normal file
49
eugtk/examples/test85.ex
Normal file
@@ -0,0 +1,49 @@
|
||||
|
||||
------------------------------------------------------------------------
|
||||
--# GtkLabel with web link
|
||||
------------------------------------------------------------------------
|
||||
|
||||
include GtkEngine.e
|
||||
include std/net/dns.e
|
||||
|
||||
constant win = create(GtkWindow,"size=200x100,border_width=10,position=1,$destroy=Quit")
|
||||
|
||||
constant panel = create(GtkBox,VERTICAL)
|
||||
add(win,panel)
|
||||
|
||||
constant img = create(GtkImage,"thumbnails/mongoose.png")
|
||||
add(panel,img)
|
||||
|
||||
constant lbl = create(GtkLabel,{
|
||||
{"markup","""Click <a href="http://openeuphoria.org">OpenEu</a>"""},
|
||||
{"margin bottom",10},
|
||||
{"connect","activate-link","OpenLink"}})
|
||||
add(panel,lbl)
|
||||
|
||||
constant btn1 = create(GtkButton,"gtk-quit","Quit")
|
||||
constant btnbox = create(GtkButtonBox)
|
||||
add(btnbox,{btn1})
|
||||
pack(panel,-btnbox)
|
||||
|
||||
show_all(win)
|
||||
main()
|
||||
|
||||
----------------------------------------------------
|
||||
global function OpenLink()
|
||||
----------------------------------------------------
|
||||
object uri = get(lbl,"current uri")
|
||||
if not inet_connected()
|
||||
or atom(host_by_name(uri)) then
|
||||
Warn(win,"Error","Cannot connect to Web",uri,,"face-crying")
|
||||
end if
|
||||
return 1
|
||||
end function
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user