added eugtk examples
This commit is contained in:
111
eugtk/examples/test0.ex
Normal file
111
eugtk/examples/test0.ex
Normal file
@@ -0,0 +1,111 @@
|
||||
|
||||
|
||||
---------------------------------------------------------------------------------------
|
||||
--# EuGTK Info
|
||||
-- Displays a lot of data gathered by EuGTK about the platform.
|
||||
-- Don't be concerned that this looks complex. Go on to test1, etc.
|
||||
-- to see how easy EuGTK can be!
|
||||
---------------------------------------------------------------------------------------
|
||||
|
||||
include GtkEngine.e
|
||||
|
||||
get_net_address() -- check current address;
|
||||
-- don't call this unless you're needing it!
|
||||
|
||||
----------------------------------------------------
|
||||
-- Interface:
|
||||
-- This uses std/format to allow [{named}]
|
||||
-- parameters. This makes it easy to move things
|
||||
-- around, add or delete items. Labels use markup
|
||||
-- to style the text.
|
||||
----------------------------------------------------
|
||||
|
||||
constant fmt1 = -- stuff for left side;
|
||||
|
||||
`<b><u>EuGTK</u></b> <small>
|
||||
<b>Version:</b> [{version}]
|
||||
<b>Date:</b> [{release}]
|
||||
[{copyright}]</small>
|
||||
|
||||
<b><u>GTK</u></b><small>
|
||||
<b>Lib version:</b> [{major}].[{minor}].[{micro}]</small>
|
||||
|
||||
<b><u>Euphoria</u></b><small>
|
||||
<b>Version:</b> [{eu_version}]
|
||||
<b>Revision:</b> [{eu_revision}]
|
||||
<b>Platform:</b> [{eu_platform}]
|
||||
<b>Bits:</b> [{eu_arch_bits}]
|
||||
<b>Date:</b> [{eu_date}]</small>
|
||||
|
||||
<b><u>Platform</u></b><small>
|
||||
<b>OS:</b> [{os_name}]
|
||||
<b>Distro:</b> [{os_distro}]
|
||||
<b>Version:</b> [{os_vers}]
|
||||
<b>Architecture</b> [{os_arch}]</small>`
|
||||
|
||||
constant fmt2 = -- stuff for right side;
|
||||
`
|
||||
|
||||
<b><u>User</u></b><small>
|
||||
<b>User name:</b> [{user_name}]
|
||||
<b>Full name:</b> [{real_name}]
|
||||
<b>Home Dir:</b> [{home_dir}]
|
||||
<b>Terminal:</b> [{os_term}]
|
||||
<b>Shell:</b> [{os_shell}]
|
||||
<b>Language:</b> [{def_lang}]
|
||||
</small>
|
||||
|
||||
<b><u>Application</u></b><small>
|
||||
<b>App name:</b> [{app_name}]
|
||||
<b>Prog name:</b> [{prg_name}]
|
||||
<b>Process ID:</b> [{os_pid}]
|
||||
<b>Curr Dir:</b> [{curr_dir}]
|
||||
<b>Temp Dir:</b> [{temp_dir}]
|
||||
<b>Data Dir:</b> [{data_dir}]
|
||||
<b>Config Dir:</b> [{conf_dir}]
|
||||
</small>
|
||||
`
|
||||
constant fmt3 = -- for the bottom;
|
||||
`
|
||||
|
||||
<b><u>Other</u></b><small>
|
||||
<b>Host Name:</b> [{host_name}]
|
||||
<b>Host Addr:</b> [{host_addr}]
|
||||
<b>Today:</b> [{today}]
|
||||
<b>Start Time:</b> [{start_time}]
|
||||
<b>Runtime Dir:</b> [{runt_dir}]
|
||||
</small>
|
||||
|
||||
`
|
||||
-------------------------------------------------------------------------
|
||||
-- Main Window
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
constant win = create(GtkWindow,"size=250x-1,border=10,position=1,$destroy=Quit")
|
||||
|
||||
constant grid = create(GtkGrid,"column_spacing=10")
|
||||
add(win,grid)
|
||||
|
||||
constant img = create(GtkImage,"thumbnails/eugtk.png")
|
||||
set(grid,"attach",img,1,1,2,1)
|
||||
|
||||
constant lbl_left = create(GtkLabel)
|
||||
set(lbl_left,"markup",format(fmt1,info))
|
||||
set(grid,"attach",lbl_left,1,2,1,1)
|
||||
|
||||
constant lbl_right = create(GtkLabel)
|
||||
set(lbl_right,"markup",format(fmt2,info))
|
||||
set(grid,"attach",lbl_right,2,2,1,1)
|
||||
|
||||
constant lbl_bot = create(GtkLabel)
|
||||
set(lbl_bot,"markup",format(fmt3,info))
|
||||
set(grid,"attach",lbl_bot,1,3,2,1)
|
||||
|
||||
constant box = create(GtkButtonBox),
|
||||
btn = create(GtkButton,"gtk-close","Quit")
|
||||
add(box,btn)
|
||||
set(grid,"attach",box,1,4,2,1)
|
||||
|
||||
show_all(win)
|
||||
ifdef IAB then set(win,"interactive debugging",1) end ifdef
|
||||
main()
|
||||
Reference in New Issue
Block a user