Smarteiffel

This is a discussion on Smarteiffel within the Eiffel forums in Programming Languages category; Dear all, I want to write a (smart)eiffel program, where I want to launch some graphical windows from within the command line. The following graphic hello_world program included with smarteiffel works perfectly. In particular I can close the toplevel window. class HELLO inherit GRAPHIC creation {ANY} make feature {} toplevel_window: TOPLEVEL_WINDOW make is local label: LABEL do create toplevel_window.default_create toplevel_window.set_title("Hello World") toplevel_window.set_background_color(white_color) toplevel_window.map -- put the window on the screen; may be done later create label.make(U"Hello World !") toplevel_window.child_attach(label) -- register procedure to call on user requests on 'quit' toplevel_window.when_close_requested( agent vision.loop_stack.break) -- start the event loop. The event loop ...

Go Back   Application Development Forum > Programming Languages > Eiffel

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 10-27-2007, 03:44 PM
Jean RUPPERT
Guest
 
Default Smarteiffel

Dear all,

I want to write a (smart)eiffel program, where I want to
launch some graphical windows from within the command line.

The following graphic hello_world program included with
smarteiffel works perfectly. In particular I can close the
toplevel window.

class HELLO

inherit
GRAPHIC

creation {ANY}
make

feature {}
toplevel_window: TOPLEVEL_WINDOW

make is
local
label: LABEL
do
create toplevel_window.default_create
toplevel_window.set_title("Hello World")
toplevel_window.set_background_color(white_color)
toplevel_window.map
-- put the window on the screen; may be done later
create label.make(U"Hello World !")
toplevel_window.child_attach(label)
-- register procedure to call on user requests on 'quit'
toplevel_window.when_close_requested(
agent vision.loop_stack.break)
-- start the event loop. The event loop executes registred
-- behavior for user actions.
-- It will stop when break is called
--(vision.loop_stack.break).
vision.start
io.put_string("The end%N")
end

end -- class HELLO


However the following modification of the graphic hello world programm
does no work.

class TEXT_GRAPHIC_HELLO

inherit
GRAPHIC
-- Give access to constants (vision, colors...)

creation {ANY}
make

feature {ANY}
make is
local
input: STRING
label: LABEL
do
std_input.read_line
from input:=std_input.last_string until input.is_equal("quit")
loop
create toplevel_window.default_create
toplevel_window.set_title("Hello World")

toplevel_window.set_background_color(white_color)
toplevel_window.map
create label.make(U"Hello")
toplevel_window.child_attach(label)
-- register procedure to call on user requests on 'quit'
toplevel_window.when_close_requested(
agent vision.loop_stack.break)
vision.start
std_input.read_line
input:=std_input.last_string
end
end

toplevel_window: TOPLEVEL_WINDOW

end -- class TEXT_GRAPHIC_HELLO

This program compiles perfectly on debian gnu linux etch on
smarteiffel 2.3. It is also possible to start it, on the
commandline you can then enter a command different to quit,
the hello world window will then pop up, however it is
impossible to close it. It seems to me that
"toplevel_window.when_close_requested(agent vision.loop_stack.break)"
does not work. Can anyone help me

Thanks

Jean
Reply With Quote
  #2  
Old 10-30-2007, 07:24 AM
llothar
Guest
 
Default Re: Smarteiffel

On 28 Okt., 02:44, Jean RUPPERT <ruppe...@pt.lu> wrote:

This should be posted on the mailing list. Unfortunately these guys
still havend fixed the
broken mailing list link on the smalleiffel website. So nobody who is
new to SmartEiffel can
subscribe.


Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 07:28 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.