~ubuntu-branches/ubuntu/utopic/fltk1.1/utopic

« back to all changes in this revision

Viewing changes to documentation/osissues.html

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2004-12-04 12:59:54 UTC
  • mto: (2.1.1 hoary)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20041204125954-4792872ghx55a78w
Tags: upstream-1.1.6
ImportĀ upstreamĀ versionĀ 1.1.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
333
333
 
334
334
<H3>Setting the Icon of a Window</H3>
335
335
 
336
 
<P>FLTK currently supports setting a window's icon *before* it
 
336
<P>FLTK currently supports setting a window's icon <b>before</b> it
337
337
is shown using the <TT>Fl_Window::icon()</TT> method.
338
338
 
339
339
<H4>void Fl_Window::icon(char *)</H4>
340
340
 
341
341
<P>Sets the icon for the window to the passed pointer. You will
342
342
need to cast the icon <TT>Pixmap</TT> to a <TT>char *</TT> when
343
 
calling this method. To set the icon using a bitmap compiled
 
343
calling this method. To set a monochrome icon using a bitmap compiled
344
344
with your application use:
345
345
 
346
346
<UL><PRE>
347
347
#include &quot;icon.xbm&quot;
348
348
 
 
349
fl_open_display(); // needed if display has not been previously opened
 
350
 
349
351
Pixmap p = XCreateBitmapFromData(fl_display, DefaultRootWindow(fl_display),
350
352
                                 icon_bits, icon_width, icon_height);
351
353
 
352
354
window-&gt;icon((char *)p);
353
355
</PRE></UL>
354
356
 
 
357
<P>To use a multi-colored icon, the XPM format and library
 
358
should be used as follows:
 
359
 
 
360
<UL><PRE>
 
361
#include &lt;X11/xpm.h&gt;
 
362
#include &quot;icon.xpm&quot;
 
363
 
 
364
fl_opendisplay();                // needed if display has not been previously opened
 
365
 
 
366
Pixmap p, mask;
 
367
 
 
368
XpmCreatePixmapFromData(fl_display, DefaultRootWindow(fl_display),
 
369
                                 icon_xpm, &amp;p, &amp;mask, NULL);
 
370
 
 
371
window-&gt;icon((char *)p);
 
372
</PRE></UL>
 
373
 
 
374
<p>When using the Xpm library, be sure to include it in the list
 
375
of libraries that are used to link the application (usually
 
376
"-lXpm").</p>
 
377
 
355
378
<CENTER><TABLE WIDTH="90%" BORDER="1" CELLPADDING="5" CELLSPACING="0" BGCOLOR="#cccccc">
356
379
<TR>
357
380
        <TD><B>NOTE:</B>