diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-11-29 19:24:00 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-11-29 19:24:00 +0000 |
| commit | 09daf20b81cdae78772f07c0af22a571d7cc73eb (patch) | |
| tree | 1641f788cafe20b505355b0479ba0d528297eb30 /documentation/Fl_Window.html | |
| parent | b105ab8b7fb6281635076559aae96f2b3b12fc51 (diff) | |
Documentation updates galore (up to chapter 7, still need to do chapter
8 and 9, tweek the appendices, and recapture the screenshots...)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1786 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'documentation/Fl_Window.html')
| -rw-r--r-- | documentation/Fl_Window.html | 190 |
1 files changed, 95 insertions, 95 deletions
diff --git a/documentation/Fl_Window.html b/documentation/Fl_Window.html index 2323a38e3..a245e2d52 100644 --- a/documentation/Fl_Window.html +++ b/documentation/Fl_Window.html @@ -20,17 +20,17 @@ </PRE> </UL> <H3>Description</H3> - This widget produces an actual window. This can either be a main -window, with a border and title and all the window management controls, -or a "subwindow" inside a window. This is controlled by whether or not -the window has a <TT>parent()</TT>. + This widget produces an actual window. This can either be a main +window, with a border and title and all the window management controls, +or a "subwindow" inside a window. This is controlled by whether or not +the window has a <TT>parent()</TT>. <P>Once you create a window, you usually add children <TT>Fl_Widget</TT> 's to it by using <TT>window->add(child)</TT> for each new widget. See <A -href=Fl_Group.html#Fl_Group><TT>Fl_Group</TT></A> for more information +href=Fl_Group.html#Fl_Group><TT>Fl_Group</TT></A> for more information on how to add and remove children. </P> -<P>There are several subclasses of <TT>Fl_Window</TT> that provide +<P>There are several subclasses of <TT>Fl_Window</TT> that provide double-buffering, overlay, menu, and OpenGL support. </P> -<P>The window's callback is done if the user tries to close a window +<P>The window's callback is done if the user tries to close a window using the window manager and <A href=functions.html#modal><TT> Fl::modal()</TT></A> is zero or equal to the window. <TT>Fl_Window</TT> has a default callback that calls <TT>Fl_Window::hide()</TT>. </P> @@ -89,9 +89,9 @@ place to show the window or allow the user to pick a location. If you want to force a position you should call <tt>position(x,y)</tt> or <tt>hotspot()</tt> before calling <tt>show()</tt>. -<P><TT>Fl_Widget::box()</TT> is set to <TT>FL_FLAT_BOX</TT>. If you -plan to completely fill the window with children widgets you should -change this to <TT>FL_NO_BOX</TT>. If you turn the window border off +<P><TT>Fl_Widget::box()</TT> is set to <TT>FL_FLAT_BOX</TT>. If you +plan to completely fill the window with children widgets you should +change this to <TT>FL_NO_BOX</TT>. If you turn the window border off you may want to change this to <TT>FL_UP_BOX</TT>. </P> <h4>Fl_Window::Fl_Window(int x, int y, int w, int h, const char *title = 0)</H4> @@ -100,157 +100,157 @@ you may want to change this to <TT>FL_UP_BOX</TT>. </P> leaves <tt>visible()</tt> set to true. <H4><A name=Fl_Window.~Fl_Window>virtual Fl_Window::~Fl_Window()</A></H4> - The destructor <I>also deletes all the children</I>. This allows a -whole tree to be deleted at once, without having to keep a pointer to + The destructor <I>also deletes all the children</I>. This allows a +whole tree to be deleted at once, without having to keep a pointer to all the children in the user code. A kludge has been done so the <TT> -Fl_Window</TT> and all of it's children can be automatic (local) -variables, but you must declare the <TT>Fl_Window</TT> <I>first</I> so -that it is destroyed last. -<H4><A name=Fl_Window.size_range>void Fl_Window::size_range(int minw, +Fl_Window</TT> and all of it's children can be automatic (local) +variables, but you must declare the <TT>Fl_Window</TT> <I>first</I> so +that it is destroyed last. +<H4><A name=Fl_Window.size_range>void Fl_Window::size_range(int minw, int minh, int maxw=0, int maxh=0, int dw=0, int dh=0, int aspect=0)</A></H4> - Set the allowable range the user can resize this window to. This only -works for top-level windows. + Set the allowable range the user can resize this window to. This only +works for top-level windows. <UL> -<LI><TT>minw</TT> and <TT>minh</TT> are the smallest the window can +<LI><TT>minw</TT> and <TT>minh</TT> are the smallest the window can be. </LI> -<LI><TT>maxw</TT> and <TT>maxh</TT> are the largest the window can be. - If either is <I>equal</I> to the minimum then you cannot resize in -that direction. If either is zero then FLTK picks a maximum size in +<LI><TT>maxw</TT> and <TT>maxh</TT> are the largest the window can be. + If either is <I>equal</I> to the minimum then you cannot resize in +that direction. If either is zero then FLTK picks a maximum size in that direction such that the window will fill the screen. </LI> -<LI><TT>dw</TT> and <TT>dh</TT> are size increments. The window will +<LI><TT>dw</TT> and <TT>dh</TT> are size increments. The window will be constrained to widths of <TT>minw + N * dw</TT>, where <TT>N</TT> - is any non-negative integer. If these are less or equal to 1 they + is any non-negative integer. If these are less or equal to 1 they are ignored. (this is ignored on WIN32)</LI> -<LI><TT>aspect</TT> is a flag that indicates that the window should - preserve it's aspect ratio. This only works if both the maximum and +<LI><TT>aspect</TT> is a flag that indicates that the window should + preserve it's aspect ratio. This only works if both the maximum and minimum have the same aspect ratio. (ignored on WIN32 and by many X window managers)</LI> </UL> - If this function is not called, FLTK tries to figure out the range + If this function is not called, FLTK tries to figure out the range from the setting of <A href="Fl_Group.html#Fl_Group.resizable"><TT>resizable()</TT></A>: <UL> -<LI>If <TT>resizable()</TT> is <TT>NULL</TT> (this is the default) -then the window cannot be resized and the resize border and max-size +<LI>If <TT>resizable()</TT> is <TT>NULL</TT> (this is the default) +then the window cannot be resized and the resize border and max-size control will not be displayed for the window. </LI> -<LI>If either dimension of <TT>resizable()</TT> is less than 100, +<LI>If either dimension of <TT>resizable()</TT> is less than 100, then that is considered the minimum size. Otherwise the <TT> resizable()</TT> has a minimum size of 100. </LI> -<LI>If either dimension of <TT>resizable()</TT> is zero, then that is +<LI>If either dimension of <TT>resizable()</TT> is zero, then that is also the maximum size (so the window cannot resize in that direction). </LI> </UL> - It is undefined what happens if the current size does not fit in the -constraints passed to <TT>size_range()</TT>. + It is undefined what happens if the current size does not fit in the +constraints passed to <TT>size_range()</TT>. <H4><A name=Fl_Window.show>virtual void Fl_Window::show() <BR> void Fl_Window::show(int argc, char **argv)</A></H4> -Put the window on the screen. Usually this has the side effect of -opening the display. The second form is used for top-level -windows and allow standard arguments to be parsed from the +Put the window on the screen. Usually this has the side effect of +opening the display. The second form is used for top-level +windows and allow standard arguments to be parsed from the command-line. -<P>If the window is already shown then it is restored and raised to the +<P>If the window is already shown then it is restored and raised to the top. This is really convenient because your program can call <TT>show()</TT> at any time, even if the window is already up. It also means that <TT> show()</TT> serves the purpose of <TT>raise()</TT> in other toolkits. </P> <H4><A name=Fl_Window.hide>virtual void Fl_Window::hide()</A></H4> - Remove the window from the screen. If the window is already hidden or + Remove the window from the screen. If the window is already hidden or has not been shown then this does nothing and is harmless. <H4><A name=Fl_Window.shown>int Fl_Window::shown() const</A></H4> Returns non-zero if <TT>show()</TT> has been called (but not <TT>hide()</TT> -). You can tell if a window is iconified with <TT>(w->shown() -&!w->visible())</TT>. +). You can tell if a window is iconified with <TT>(w->shown() +&!w->visible())</TT>. <H4><A name=Fl_Window.iconize>void Fl_Window::iconize()</A></H4> - Iconifies the window. If you call this when <TT>shown()</TT> is false -it will <TT>show()</TT> it as an icon. If the window is already -iconified this does nothing. + Iconifies the window. If you call this when <TT>shown()</TT> is false +it will <TT>show()</TT> it as an icon. If the window is already +iconified this does nothing. <P>Call <TT>show()</TT> to restore the window. </P> -<P>When a window is iconified/restored (either by these calls or by the +<P>When a window is iconified/restored (either by these calls or by the user) the <TT>handle()</TT> method is called with <TT>FL_HIDE</TT> and <TT> FL_SHOW</TT> events and <TT>visible()</TT> is turned on and off. </P> -<P>There is no way to control what is drawn in the icon except with the -string passed to <TT>Fl_Window::xclass()</TT>. You should not rely on +<P>There is no way to control what is drawn in the icon except with the +string passed to <TT>Fl_Window::xclass()</TT>. You should not rely on window managers displaying the icons. </P> <H4><A name=Fl_Window.resize>void Fl_Window::resize(int,int,int,int)</A></H4> - Change the size and position of the window. If <TT>shown()</TT> is -true, these changes are communicated to the window server (which may -refuse that size and cause a further resize). If <TT>shown()</TT> is -false, the size and position are used when <TT>show()</TT> is called. -See <A href=Fl_Group.html#Fl_Group><TT>Fl_Group</TT></A> for the effect -of resizing on the child widgets. + Change the size and position of the window. If <TT>shown()</TT> is +true, these changes are communicated to the window server (which may +refuse that size and cause a further resize). If <TT>shown()</TT> is +false, the size and position are used when <TT>show()</TT> is called. +See <A href=Fl_Group.html#Fl_Group><TT>Fl_Group</TT></A> for the effect +of resizing on the child widgets. <P>You can also call the <TT>Fl_Widget</TT> methods <TT>size(x,y)</TT> - and <TT>position(w,h)</TT>, which are inline wrappers for this virtual + and <TT>position(w,h)</TT>, which are inline wrappers for this virtual function. </P> <H4><A name=Fl_Window.free_position>void Fl_Window::free_position()</A></H4> Undoes the effect of a previous <TT>resize()</TT> or <TT>show()</TT> - so that the next time <TT>show()</TT> is called the window manager is -free to position the window. -<H4><A name=Fl_Window.hotspot>void Fl_Window::hotspot(int x, int y, int + so that the next time <TT>show()</TT> is called the window manager is +free to position the window. +<H4><A name=Fl_Window.hotspot>void Fl_Window::hotspot(int x, int y, int offscreen = 0) <BR> void Fl_Window::hotspot(const Fl_Widget*, int offscreen = 0) <BR> void Fl_Window::hotspot(const Fl_Widgetp, int offscreen = 0)</A></H4> -<TT>position()</TT> the window so that the mouse is pointing at the -given position, or at the center of the given widget, which may be the -window itself. If the optional <TT>offscreen</TT> parameter is -non-zero, then the window is allowed to extend off the screen (this -does not work with some X window managers). +<TT>position()</TT> the window so that the mouse is pointing at the +given position, or at the center of the given widget, which may be the +window itself. If the optional <TT>offscreen</TT> parameter is +non-zero, then the window is allowed to extend off the screen (this +does not work with some X window managers). <H4><A name=Fl_Window.fullscreen>void Fl_Window::fullscreen()</A></H4> - Makes the window completely fill the screen, without any window -manager border visible. You must use <TT>fullscreen_off()</TT> to undo -this. This may not work with all window managers. -<H4><A name=Fl_Window.fullscreen_off>int Fl_Window::fullscreen_off(int + Makes the window completely fill the screen, without any window +manager border visible. You must use <TT>fullscreen_off()</TT> to undo +this. This may not work with all window managers. +<H4><A name=Fl_Window.fullscreen_off>int Fl_Window::fullscreen_off(int x, int y, int w, int h)</A></H4> Turns off any side effects of <TT>fullscreen()</TT> and does <TT> -resize(x,y,w,h)</TT>. +resize(x,y,w,h)</TT>. <H4><A name=Fl_Window.border>int Fl_Window::border(int) <BR> uchar Fl_Window::border() const</A></H4> - Gets or sets whether or not the window manager border is around the -window. The default value is true. <TT>border(n)</TT> can be used to -turn the border on and off, and returns non-zero if the value has been + Gets or sets whether or not the window manager border is around the +window. The default value is true. <TT>border(n)</TT> can be used to +turn the border on and off, and returns non-zero if the value has been changed. <I>Under most X window managers this does not work after <TT> show()</TT> has been called, although SGI's 4DWM does work.</I> <H4><A name=Fl_Window.clear_border>void Fl_Window::clear_border()</A></H4> -<TT>clear_border()</TT> is a fast inline function to turn the border -off. It only works before <TT>show()</TT> is called. +<TT>clear_border()</TT> is a fast inline function to turn the border +off. It only works before <TT>show()</TT> is called. <H4><A name=Fl_Window.set_modal>void Fl_Window::set_modal()</A></H4> - A "modal" window, when <TT>shown()</TT>, will prevent any events from -being delivered to other windows in the same program, and will also -remain on top of the other windows (if the X window manager supports -the "transient for" property). Several modal windows may be shown at -once, in which case only the last one shown gets events. You can see + A "modal" window, when <TT>shown()</TT>, will prevent any events from +being delivered to other windows in the same program, and will also +remain on top of the other windows (if the X window manager supports +the "transient for" property). Several modal windows may be shown at +once, in which case only the last one shown gets events. You can see which window (if any) is modal by calling <A href=functions.html#modal><TT> -Fl::modal()</TT></A>. +Fl::modal()</TT></A>. <H4><A name=Fl_Window.modal>uchar Fl_Window::modal() const</A></H4> - Returns true if this window is modal. + Returns true if this window is modal. <H4><A name=Fl_Window.set_non_modal>void Fl_Window::set_non_modal()</A></H4> - A "non-modal" window (terminology borrowed from Microsoft Windows) -acts like a <TT>modal()</TT> one in that it remains on top, but it has -no effect on event delivery. There are <I>three</I> states for a -window: modal, non-modal, and normal. + A "non-modal" window (terminology borrowed from Microsoft Windows) +acts like a <TT>modal()</TT> one in that it remains on top, but it has +no effect on event delivery. There are <I>three</I> states for a +window: modal, non-modal, and normal. <H4><A name=Fl_Window.non_modal>uchar Fl_Window::non_modal() const</A></H4> - Returns true if this window is modal or non-modal. + Returns true if this window is modal or non-modal. <H4><A name=Fl_Window.label>void Fl_Window::label(const char*) <BR> const char* Fl_Window::label() const</A></H4> - Gets or sets the window title bar label. + Gets or sets the window title bar label. <H4><A name=Fl_Window.iconlabel>void Fl_Window::iconlabel(const char*) <BR> const char* Fl_Window::iconlabel() const</A></H4> - Gets or sets the icon label. + Gets or sets the icon label. <H4><A name=Fl_Window.xclass>void Fl_Window::xclass(const char*) <BR> const char* Fl_Window::xclass() const</A></H4> - A string used to tell the system what type of window this is. Mostly -this identifies the picture to draw in the icon. <I>Under X, this is -turned into a <TT>XA_WM_CLASS</TT> pair by truncating at the first -non-alphanumeric character and capitalizing the first character, and -the second one if the first is 'x'. Thus "foo" turns into "foo, Foo", + A string used to tell the system what type of window this is. Mostly +this identifies the picture to draw in the icon. <I>Under X, this is +turned into a <TT>XA_WM_CLASS</TT> pair by truncating at the first +non-alphanumeric character and capitalizing the first character, and +the second one if the first is 'x'. Thus "foo" turns into "foo, Foo", and "xprog.1" turns into "xprog, XProg".</I> This only works if called <I> -before</I> calling <TT>show()</TT>. +before</I> calling <TT>show()</TT>. <P>Under Microsoft Windows this string is used as the name of the WNDCLASS structure, though it is not clear if this can have any visible effect. </P> <H4><A name=Fl_Window.make_current>void Fl_Window::make_current()</A></H4> <TT>make_current()</TT> sets things up so that the drawing functions in <A -href=drawing.html#Drawing><TT><FL/fl_draw.H></TT></A> will go into this -window. This is useful for incremental update of windows, such as in an -idle callback, which will make your program behave much better if it -draws a slow graphic. <B>Danger: incremental update is very hard to +href=drawing.html#Drawing><TT><FL/fl_draw.H></TT></A> will go into this +window. This is useful for incremental update of windows, such as in an +idle callback, which will make your program behave much better if it +draws a slow graphic. <B>Danger: incremental update is very hard to debug and maintain!</B> <P>This method only works for the <TT>Fl_Window</TT> and <TT> Fl_Gl_Window</TT> classes. </P> |
