display a window without giving the hand to the user

View: New views
8 Messages — Rating Filter:   Alert me  

display a window without giving the hand to the user

by Thomas De Contes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi :-)


for some usage, i want to display a window for a litle bit of time,  
but not give the hand to the user, and close it automatically later

is it possible ?
i didn't succeed in display the window without Gtk.Main.Main


--
j'agis contre l'assistanat, je travaille dans une SCOP !


_______________________________________________
gtkada mailing list
gtkada@...
http://lists.adacore.com/mailman/listinfo/gtkada

Re: display a window without giving the hand to the user

by Thomas De Contes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Le 17 oct. 07 à 03:29, Thomas De Contes a écrit :

> for some usage, i want to display a window for a litle bit of time,
> but not give the hand to the user, and close it automatically later
>
> is it possible ?
> i didn't succeed in display the window without Gtk.Main.Main


        Window : Gtk.Window.Gtk_Window;
begin
        Gtk.Window.Gtk_New (Window);

        Gtk.Window.Show_All (Window);
        Gtk.Main.Main;


it displays the Window
it's right, but it waits for Main_Quit, and i don't want that

if i comment Show_All, it doesn't display the Window
it's right

but if i comment Main instead, it doesn't display the Window more !
why ?


how can i do, please ?


--
j'agis contre l'assistanat, je travaille dans une SCOP !


_______________________________________________
gtkada mailing list
gtkada@...
http://lists.adacore.com/mailman/listinfo/gtkada

Re: display a window without giving the hand to the user

by Stefan Bellon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thomas De Contes wrote:
> for some usage, i want to display a window for a litle bit of time,  
> but not give the hand to the user, and close it automatically later

Create the window as popup window using Gtk.Enums.Window_Popup and then
register a simple "Destroy" procedure with Glib.Main.Timeout_Add that
closes the window after the time you want.

Greetings,
Stefan

--
Stefan Bellon
_______________________________________________
gtkada mailing list
gtkada@...
http://lists.adacore.com/mailman/listinfo/gtkada

Re: display a window without giving the hand to the user

by Thomas De Contes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Le 21 oct. 07 à 12:00, Stefan Bellon a écrit :

> Thomas De Contes wrote:
>> for some usage, i want to display a window for a litle bit of time,
>> but not give the hand to the user, and close it automatically later
>
> Create the window as popup window using Gtk.Enums.Window_Popup and  
> then
> register a simple "Destroy" procedure with Glib.Main.Timeout_Add that
> closes the window after the time you want.

in fact Window_Popup doesn't works for my problem

(it is very specific :
http://groups.google.fr/group/fr.comp.os.mac-os.x/browse_thread/ 
thread/3985c57539a57636/3df9d9564ea8ede3
i try to make a little program which open a windows an then quit, as  
fast as possible)


maybe it would work if i use Glib.Main.Timeout_Add to call Main_Quit

could you help me to do that, please ?
i don't understand all the arguments, and i don't know what i should put


--
j'agis contre l'assistanat, je travaille dans une SCOP !


_______________________________________________
gtkada mailing list
gtkada@...
http://lists.adacore.com/mailman/listinfo/gtkada

Re: display a window without giving the hand to the user

by Stefan Bellon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thomas De Contes wrote:

> in fact Window_Popup doesn't works for my problem

> (it is very specific :
> http://groups.google.fr/group/fr.comp.os.mac-os.x/browse_thread/ 
> thread/3985c57539a57636/3df9d9564ea8ede3
> i try to make a little program which open a windows an then quit, as  
> fast as possible)

I'm sorry, those messages are in French and although I learnt French at
school, it's too tedious for me to translate them. And I didn't see any
references to GtkAda.

> maybe it would work if i use Glib.Main.Timeout_Add to call Main_Quit

> could you help me to do that, please ?
> i don't understand all the arguments, and i don't know what i should
> put

And I still don't understand what you want to do. We use this mechanism
in order to display a splash screen for a certain amount of time during
the start of our application. I do not see why one could not make this
stand-alone without any further payload.

--
Stefan Bellon
_______________________________________________
gtkada mailing list
gtkada@...
http://lists.adacore.com/mailman/listinfo/gtkada

Re: display a window without giving the hand to the user

by Thomas De Contes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Le 22 oct. 07 à 00:01, Stefan Bellon a écrit :

> Thomas De Contes wrote:
>
>> in fact Window_Popup doesn't works for my problem
>
>> (it is very specific :
>> http://groups.google.fr/group/fr.comp.os.mac-os.x/browse_thread/
>> thread/3985c57539a57636/3df9d9564ea8ede3
>> i try to make a little program which open a windows an then quit, as
>> fast as possible)
>
> I'm sorry, those messages are in French and although I learnt  
> French at
> school, it's too tedious for me to translate them. And I didn't see  
> any
> references to GtkAda.
>
>> maybe it would work if i use Glib.Main.Timeout_Add to call Main_Quit
>
>> could you help me to do that, please ?
>> i don't understand all the arguments, and i don't know what i should
>> put
>
> And I still don't understand what you want to do. We use this  
> mechanism
> in order to display a splash screen for a certain amount of time  
> during
> the start of our application. I do not see why one could not make this
> stand-alone without any further payload.

i suppose you don't know mac os x too, and i don't want annoy you  
with things you don't care,

to circumvent a bug from mac os x's x11,
i need to make a little program which open a window (without anything  
inside) and then quit (at once)
(i want to use GtkAda to make this program because i don't know  
programming in c)

is it clear enough ?

well, it doesn't works with Window_Popup, i need to use a  
Window_Toplevel
and i don't know how to use Glib.Main.Timeout_Add at all, i never  
used it


--
j'agis contre l'assistanat, je travaille dans une SCOP !


_______________________________________________
gtkada mailing list
gtkada@...
http://lists.adacore.com/mailman/listinfo/gtkada

Re: display a window without giving the hand to the user

by Stefan Bellon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thomas De Contes wrote:

> well, it doesn't works with Window_Popup, i need to use a  
> Window_Toplevel

I can't deduce this from your desciption of what you need.

> and i don't know how to use Glib.Main.Timeout_Add at all, i never  
> used it

bellonsn@cube$ cat splashdemo.adb
with Glib.Main;
with Gtk.Enums;
with Gtk.Main;
with Gtk.Window;

procedure Splashdemo is

   Window : Gtk.Window.Gtk_Window;
   Dummy  : Glib.Main.G_Source_Id;

   function Destroy
     return Boolean
   is
      use type Gtk.Window.Gtk_Window;
   begin
      Gtk.Window.Destroy (Window);
      Gtk.Main.Main_Quit;
      return False;
   end Destroy;

begin
   Gtk.Main.Init;
   Gtk.Window.Gtk_New (Window, Gtk.Enums.Window_Popup);
   Gtk.Window.Set_Size_Request (Window, 640, 480);
   Gtk.Window.Set_Position (Window, Gtk.Enums.Win_Pos_Center);
   Gtk.Window.Show_All (Window);
   Dummy:= Glib.Main.Timeout_Add (2000, Destroy'Unrestricted_Access);
   Gtk.Main.Main;
end Splashdemo;

Size of window and duration of display is hardcoded with the integer
literals. The non-standard 'Unrestricted_Access is necessary in this
example because Destroy in this case is a nested function, if you put
the whole thing in an own package, then you can make both at the same
level and use 'Access.

I hope this helps.

Greetings,
Stefan

--
Stefan Bellon
_______________________________________________
gtkada mailing list
gtkada@...
http://lists.adacore.com/mailman/listinfo/gtkada

Re: display a window without giving the hand to the user

by Thomas De Contes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Le 22 oct. 07 à 09:01, Stefan Bellon a écrit :

> Thomas De Contes wrote:
>
>> well, it doesn't works with Window_Popup, i need to use a
>> Window_Toplevel
>
> I can't deduce this from your desciption of what you need.

you hadn't to deduce it :-)
i tried it, hopping it would work, then i saw that it didn't work,  
and then i told you :-)


> I hope this helps.

thank you very much, it works :-)


--
j'agis contre l'assistanat, je travaille dans une SCOP !


_______________________________________________
gtkada mailing list
gtkada@...
http://lists.adacore.com/mailman/listinfo/gtkada
LightInTheBox - Buy quality products at wholesale price