Bonjour,
Est-il possible d'ouvrir une boite de dialogue quand on clique de la croix (de fermeture) d'une fenêtre TK.
Ou alors, ne pas afficher la dite croix?
Merci,
Lucie








Bonjour,
Est-il possible d'ouvrir une boite de dialogue quand on clique de la croix (de fermeture) d'une fenêtre TK.
Ou alors, ne pas afficher la dite croix?
Merci,
Lucie
Je pense que cette citation de Tk::Wm répond à ta question :
En bref tu peux faire ce que tu veux à partir du moment où le Window Manager le supporte (je pense que la plupart supporte WM_DELETE_WINDOW).$toplevel->protocol(?name?,?callback?)
This method is used to manage window manager protocols such as WM_DELETE_WINDOW. Name is the name of an atom corresponding to a window manager protocol, such as WM_DELETE_WINDOW or WM_SAVE_YOURSELF or WM_TAKE_FOCUS. If both name and callback are specified, then callback is associated with the protocol specified by name. Name will be added to $toplevel's WM_PROTOCOLS property to tell the window manager that the application has a protocol handler for name, and callback will be invoked in the future whenever the window manager sends a message to the client for that protocol. In this case the method returns an empty string. If name is specified but callback isn't, then the current callback for name is returned, or an empty string if there is no handler defined for name. If callback is specified as an empty string then the current handler for name is deleted and it is removed from the WM_PROTOCOLS property on $toplevel; an empty string is returned. Lastly, if neither name nor callback is specified, the method returns a list of all the protocols for which handlers are currently defined for $toplevel.
Tk always defines a protocol handler for WM_DELETE_WINDOW, even if you haven't asked for one with protocol. If a WM_DELETE_WINDOW message arrives when you haven't defined a handler, then Tk handles the message by destroying the window for which it was received.
--
Jedaï








Je vais tester.
Merci,
Lucie
Partager