I trying to use X11 and let's say I create a text editor. Let's say the user is using the text editor, makes some changes and then clicks on the [X] to close the window before saving changes. I want to popup a "are you sure" before the window is closed but X11 doesn't allow this. How does Wine go about this problem? In Windows this is easy, in the WindowProc() just ignore WM_CLOSE.
FYI :Porting some code over to Linux and need a little help.
Thanks.
Hi,
On Thu, Jun 23, 2005 at 09:36:50PM -0400, Peter Quiring wrote:
I trying to use X11 and let's say I create a text editor. Let's say the user is using the text editor, makes some changes and then clicks on the [X] to close the window before saving changes. I want to popup a "are you sure" before the window is closed but X11 doesn't allow this. How does Wine go about this problem? In Windows this is easy, in the WindowProc() just ignore WM_CLOSE.
Sorry, I don't have too much experience in that area. Tried Google Groups and/or X11 specs?
FYI :Porting some code over to Linux and need a little help.
Wait, does all that mean you're using plain Xlib to port things over? I'd say you're much better off using things such as GTK or wxWidgets (GTK backend) or Qt. Using plain X calls for a port seems rather crazy these days, if it hasn't been all the time already (I'd wager it's the latter).
Andreas Mohr
On Thu, 23 Jun 2005 21:36:50 -0400, Peter Quiring wrote:
FYI :Porting some code over to Linux and need a little help.
Use GTK+ instead of Xlib (bonus: your new Linux port will also run on Windows) and connect to the delete signal (I think that's it). You can veto the close there. There's plenty of example code you can use in other open source GTK+ apps (for instance, GEdit).
thanks -mike