Re: EuGTK - Q: how to show a picture before main()

new topic     » goto parent     » topic index » view thread      » older message » newer message
jimcbrown said...

I just tested the following code with EuGTK 4.1.5 and it seems to work. There's probably a more "correct" way of calling gtk_main_iteration() and gtk_events_pending() from EuGTK but I'll let Irv comment on that.

procedure getUSDAdata() 
	integer k 
	k = -1 
	while k = -1 do 
		k = get_key() 
	end while 
end procedure 
 
include GtkEngine.e 
include std/dll.e 
 
-- some code here 
 
global constant Win = create(GtkWindow) 
 
-- some code here 
 
constant splash = create(GtkWindow) 
 
-- some code here 
 
constant gtk_events_pending_ = define_c_func(GTK, "gtk_events_pending", {}, C_INT) 
constant gtk_main_iteration_ = define_c_proc(GTK, "gtk_main_iteration", {}) 
 
  show_all(splash)  -- This shows -before- the data is loaded. 
while c_func(gtk_events_pending_, {}) do 
	c_proc(gtk_main_iteration_, {}) 
end while 
  getUSDAdata() 
  hide(splash) 
 
-- some code here 
 
show_all(Win) 
main() 

Thanks. That works.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu