> I have two windows both created in main. I need to disable
> the maximize button on the first window and disable the close
> button on the second window. I tried several things nothing
> seem to work for me. Any one know how, please give me some help.
I think this sort of does what you want, though it does not actually
remove the CLOSE button from window2, it only disables it.
I think the problem is that all fltk windows are essentially the same
"class" in Win32 terms, so if you use SetClassLong(...) to remove the
CLOSE button it removes the close button from *all* windows.
With fltk-1.3 I think it is possible to specify different "class" values
for each window, which might then allow you to use SetClassLong(...)
safely on win2 without also affecting win1.
However - try this example - it may be good enough for your needs.
// fltk-config --compile test.cxx
#include <FL/Fl_Window.H>
#include <FL/Fl.H>
#include <FL/x.H>
static Fl_Window *win1 = 0;
static Fl_Window *win2 = 0;
// Callback of the window menu-close button
void close_cb(Fl_Widget *, void *) {
if(win1) win1->hide();
if(win2) win2->hide();
}
void null_cb(Fl_Widget *, void *) {
}
int main(int argc, char** argv)
{
win1 = new Fl_Window(100,100,200,400, "Win 1");
win1->begin();
win1->end();
win1->callback(close_cb);
win2 = new Fl_Window(350,100,200,400, "Win 2");
win2->begin();
win2->end();
win2->resizable(win2);
win2->callback(null_cb);
win1->show(argc, argv);
win2->show();
HWND hw1 = fl_xid(win1);
SetWindowLong(hw1,GWL_STYLE,(GetWindowLong(hw1,GWL_STYLE)&~WS_MAXIMIZEBO
X));
SetWindowPos(hw1, HWND_TOP, 0, 0, 0, 0, (SWP_NOMOVE | SWP_NOSIZE |
SWP_SHOWWINDOW | SWP_FRAMECHANGED));
HWND hw2 = fl_xid(win2);
// SetClassLong(hw2,GCL_STYLE,GetClassLong(hw2,GCL_STYLE)|CS_NOCLOSE);
SetWindowLong(hw2,GWL_STYLE,(GetWindowLong(hw2,GWL_STYLE)|WS_MAXIMIZEBOX
));
SetWindowPos(hw2, HWND_TOP, 0, 0, 0, 0, (SWP_NOMOVE | SWP_NOSIZE |
SWP_SHOWWINDOW | SWP_FRAMECHANGED));
return Fl::run();
}
/* end of file */
SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14
3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk