<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Fox::FXDCWindow
— FXRuby API Documentation
</title>
<link rel="stylesheet" href="../css/style.css" type="text/css" />
<link rel="stylesheet" href="../css/common.css" type="text/css" />
<script type="text/javascript">
pathId = "Fox::FXDCWindow";
relpath = '../';
</script>
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
</head>
<body>
<div class="nav_wrap">
<iframe id="nav" src="../class_list.html?1"></iframe>
<div id="resizer"></div>
</div>
<div id="main" tabindex="-1">
<div id="header">
<div id="menu">
<a href="../_index.html">Index (F)</a> »
<span class='title'><span class='object_link'><a href="../Fox.html" title="Fox (module)">Fox</a></span></span>
»
<span class="title">FXDCWindow</span>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="../class_list.html">
<svg width="24" height="24">
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
</svg>
</a>
</div>
<div class="clear"></div>
</div>
<div id="content"><h1>Class: Fox::FXDCWindow
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="FXDC.html" title="Fox::FXDC (class)">FXDC</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="FXDC.html" title="Fox::FXDC (class)">FXDC</a></span></li>
<li class="next">Fox::FXDCWindow</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>rdoc-sources/FXDCWindow.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>A window device context allows drawing into an FXDrawable, such as an on-screen window (i.e. FXWindow and its derivatives) or an off-screen image (FXImage and its derivatives). Because certain hardware resources are locked down, only one FXDCWindow may be locked on a drawable at any one time.</p>
</div>
</div>
<div class="tags">
</div>
<h2>Instance Attribute Summary</h2>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="FXDC.html" title="Fox::FXDC (class)">FXDC</a></span></h3>
<p class="inherited"><span class='object_link'><a href="FXDC.html#app-instance_method" title="Fox::FXDC#app (method)">#app</a></span>, <span class='object_link'><a href="FXDC.html#background-instance_method" title="Fox::FXDC#background (method)">#background</a></span>, <span class='object_link'><a href="FXDC.html#clipHeight-instance_method" title="Fox::FXDC#clipHeight (method)">#clipHeight</a></span>, <span class='object_link'><a href="FXDC.html#clipRectangle-instance_method" title="Fox::FXDC#clipRectangle (method)">#clipRectangle</a></span>, <span class='object_link'><a href="FXDC.html#clipRegion=-instance_method" title="Fox::FXDC#clipRegion= (method)">#clipRegion</a></span>, <span class='object_link'><a href="FXDC.html#clipWidth-instance_method" title="Fox::FXDC#clipWidth (method)">#clipWidth</a></span>, <span class='object_link'><a href="FXDC.html#clipX-instance_method" title="Fox::FXDC#clipX (method)">#clipX</a></span>, <span class='object_link'><a href="FXDC.html#clipY-instance_method" title="Fox::FXDC#clipY (method)">#clipY</a></span>, <span class='object_link'><a href="FXDC.html#dashLength-instance_method" title="Fox::FXDC#dashLength (method)">#dashLength</a></span>, <span class='object_link'><a href="FXDC.html#dashOffset-instance_method" title="Fox::FXDC#dashOffset (method)">#dashOffset</a></span>, <span class='object_link'><a href="FXDC.html#dashPattern-instance_method" title="Fox::FXDC#dashPattern (method)">#dashPattern</a></span>, <span class='object_link'><a href="FXDC.html#fillRule-instance_method" title="Fox::FXDC#fillRule (method)">#fillRule</a></span>, <span class='object_link'><a href="FXDC.html#fillStyle-instance_method" title="Fox::FXDC#fillStyle (method)">#fillStyle</a></span>, <span class='object_link'><a href="FXDC.html#font-instance_method" title="Fox::FXDC#font (method)">#font</a></span>, <span class='object_link'><a href="FXDC.html#foreground-instance_method" title="Fox::FXDC#foreground (method)">#foreground</a></span>, <span class='object_link'><a href="FXDC.html#function-instance_method" title="Fox::FXDC#function (method)">#function</a></span>, <span class='object_link'><a href="FXDC.html#lineCap-instance_method" title="Fox::FXDC#lineCap (method)">#lineCap</a></span>, <span class='object_link'><a href="FXDC.html#lineJoin-instance_method" title="Fox::FXDC#lineJoin (method)">#lineJoin</a></span>, <span class='object_link'><a href="FXDC.html#lineStyle-instance_method" title="Fox::FXDC#lineStyle (method)">#lineStyle</a></span>, <span class='object_link'><a href="FXDC.html#lineWidth-instance_method" title="Fox::FXDC#lineWidth (method)">#lineWidth</a></span>, <span class='object_link'><a href="FXDC.html#stipple-instance_method" title="Fox::FXDC#stipple (method)">#stipple</a></span>, <span class='object_link'><a href="FXDC.html#tile-instance_method" title="Fox::FXDC#tile (method)">#tile</a></span></p>
<h2>
Instance Method Summary
<small><a href="#" class="summary_toggle">collapse</a></small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#begin-instance_method" title="#begin (instance method)">#<strong>begin</strong>(drawable) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Lock in a drawable surface.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#end-instance_method" title="#end (instance method)">#<strong>end</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Unlock the drawable surface.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(drawable, event = nil) ⇒ FXDCWindow </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>Construct a device context for drawing into a window (specified by <em>drawable</em>).</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="FXDC.html" title="Fox::FXDC (class)">FXDC</a></span></h3>
<p class="inherited"><span class='object_link'><a href="FXDC.html#clearClipMask-instance_method" title="Fox::FXDC#clearClipMask (method)">#clearClipMask</a></span>, <span class='object_link'><a href="FXDC.html#clearClipRectangle-instance_method" title="Fox::FXDC#clearClipRectangle (method)">#clearClipRectangle</a></span>, <span class='object_link'><a href="FXDC.html#clipChildren-instance_method" title="Fox::FXDC#clipChildren (method)">#clipChildren</a></span>, <span class='object_link'><a href="FXDC.html#drawArc-instance_method" title="Fox::FXDC#drawArc (method)">#drawArc</a></span>, <span class='object_link'><a href="FXDC.html#drawArcs-instance_method" title="Fox::FXDC#drawArcs (method)">#drawArcs</a></span>, <span class='object_link'><a href="FXDC.html#drawArea-instance_method" title="Fox::FXDC#drawArea (method)">#drawArea</a></span>, <span class='object_link'><a href="FXDC.html#drawBitmap-instance_method" title="Fox::FXDC#drawBitmap (method)">#drawBitmap</a></span>, <span class='object_link'><a href="FXDC.html#drawCircle-instance_method" title="Fox::FXDC#drawCircle (method)">#drawCircle</a></span>, <span class='object_link'><a href="FXDC.html#drawEllipse-instance_method" title="Fox::FXDC#drawEllipse (method)">#drawEllipse</a></span>, <span class='object_link'><a href="FXDC.html#drawFocusRectangle-instance_method" title="Fox::FXDC#drawFocusRectangle (method)">#drawFocusRectangle</a></span>, <span class='object_link'><a href="FXDC.html#drawHashBox-instance_method" title="Fox::FXDC#drawHashBox (method)">#drawHashBox</a></span>, <span class='object_link'><a href="FXDC.html#drawIcon-instance_method" title="Fox::FXDC#drawIcon (method)">#drawIcon</a></span>, <span class='object_link'><a href="FXDC.html#drawIconShaded-instance_method" title="Fox::FXDC#drawIconShaded (method)">#drawIconShaded</a></span>, <span class='object_link'><a href="FXDC.html#drawIconSunken-instance_method" title="Fox::FXDC#drawIconSunken (method)">#drawIconSunken</a></span>, <span class='object_link'><a href="FXDC.html#drawImage-instance_method" title="Fox::FXDC#drawImage (method)">#drawImage</a></span>, <span class='object_link'><a href="FXDC.html#drawImageText-instance_method" title="Fox::FXDC#drawImageText (method)">#drawImageText</a></span>, <span class='object_link'><a href="FXDC.html#drawLine-instance_method" title="Fox::FXDC#drawLine (method)">#drawLine</a></span>, <span class='object_link'><a href="FXDC.html#drawLineSegments-instance_method" title="Fox::FXDC#drawLineSegments (method)">#drawLineSegments</a></span>, <span class='object_link'><a href="FXDC.html#drawLines-instance_method" title="Fox::FXDC#drawLines (method)">#drawLines</a></span>, <span class='object_link'><a href="FXDC.html#drawLinesRel-instance_method" title="Fox::FXDC#drawLinesRel (method)">#drawLinesRel</a></span>, <span class='object_link'><a href="FXDC.html#drawPoint-instance_method" title="Fox::FXDC#drawPoint (method)">#drawPoint</a></span>, <span class='object_link'><a href="FXDC.html#drawPoints-instance_method" title="Fox::FXDC#drawPoints (method)">#drawPoints</a></span>, <span class='object_link'><a href="FXDC.html#drawPointsRel-instance_method" title="Fox::FXDC#drawPointsRel (method)">#drawPointsRel</a></span>, <span class='object_link'><a href="FXDC.html#drawRectangle-instance_method" title="Fox::FXDC#drawRectangle (method)">#drawRectangle</a></span>, <span class='object_link'><a href="FXDC.html#drawRectangles-instance_method" title="Fox::FXDC#drawRectangles (method)">#drawRectangles</a></span>, <span class='object_link'><a href="FXDC.html#drawRoundRectangle-instance_method" title="Fox::FXDC#drawRoundRectangle (method)">#drawRoundRectangle</a></span>, <span class='object_link'><a href="FXDC.html#drawText-instance_method" title="Fox::FXDC#drawText (method)">#drawText</a></span>, <span class='object_link'><a href="FXDC.html#fillArc-instance_method" title="Fox::FXDC#fillArc (method)">#fillArc</a></span>, <span class='object_link'><a href="FXDC.html#fillArcs-instance_method" title="Fox::FXDC#fillArcs (method)">#fillArcs</a></span>, <span class='object_link'><a href="FXDC.html#fillChord-instance_method" title="Fox::FXDC#fillChord (method)">#fillChord</a></span>, <span class='object_link'><a href="FXDC.html#fillChords-instance_method" title="Fox::FXDC#fillChords (method)">#fillChords</a></span>, <span class='object_link'><a href="FXDC.html#fillCircle-instance_method" title="Fox::FXDC#fillCircle (method)">#fillCircle</a></span>, <span class='object_link'><a href="FXDC.html#fillComplexPolygon-instance_method" title="Fox::FXDC#fillComplexPolygon (method)">#fillComplexPolygon</a></span>, <span class='object_link'><a href="FXDC.html#fillComplexPolygonRel-instance_method" title="Fox::FXDC#fillComplexPolygonRel (method)">#fillComplexPolygonRel</a></span>, <span class='object_link'><a href="FXDC.html#fillConcavePolygon-instance_method" title="Fox::FXDC#fillConcavePolygon (method)">#fillConcavePolygon</a></span>, <span class='object_link'><a href="FXDC.html#fillConcavePolygonRel-instance_method" title="Fox::FXDC#fillConcavePolygonRel (method)">#fillConcavePolygonRel</a></span>, <span class='object_link'><a href="FXDC.html#fillEllipse-instance_method" title="Fox::FXDC#fillEllipse (method)">#fillEllipse</a></span>, <span class='object_link'><a href="FXDC.html#fillPolygon-instance_method" title="Fox::FXDC#fillPolygon (method)">#fillPolygon</a></span>, <span class='object_link'><a href="FXDC.html#fillPolygonRel-instance_method" title="Fox::FXDC#fillPolygonRel (method)">#fillPolygonRel</a></span>, <span class='object_link'><a href="FXDC.html#fillRectangle-instance_method" title="Fox::FXDC#fillRectangle (method)">#fillRectangle</a></span>, <span class='object_link'><a href="FXDC.html#fillRectangles-instance_method" title="Fox::FXDC#fillRectangles (method)">#fillRectangles</a></span>, <span class='object_link'><a href="FXDC.html#fillRoundRectangle-instance_method" title="Fox::FXDC#fillRoundRectangle (method)">#fillRoundRectangle</a></span>, <span class='object_link'><a href="FXDC.html#readPixel-instance_method" title="Fox::FXDC#readPixel (method)">#readPixel</a></span>, <span class='object_link'><a href="FXDC.html#setClipMask-instance_method" title="Fox::FXDC#setClipMask (method)">#setClipMask</a></span>, <span class='object_link'><a href="FXDC.html#setClipRectangle-instance_method" title="Fox::FXDC#setClipRectangle (method)">#setClipRectangle</a></span>, <span class='object_link'><a href="FXDC.html#setDashes-instance_method" title="Fox::FXDC#setDashes (method)">#setDashes</a></span></p>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<div class="method_details first">
<h3 class="signature first" id="initialize-instance_method">
#<strong>initialize</strong>(drawable, event = nil) ⇒ <tt><span class='object_link'><a href="" title="Fox::FXDCWindow (class)">FXDCWindow</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Construct a device context for drawing into a window (specified by <em>drawable</em>). If <em>event</em> is +nil_, the device context is constructed for normal drawing, and the clip rectangle is set to the whole rectange. If <em>event</em> is a reference to an FXEvent, the device context is constructed for painting in response to an expose; this sets the clip rectangle to the exposed rectangle. If an optional code block is provided, the new device context will be passed into the block as an argument and <span class='object_link'><a href="#end-instance_method" title="Fox::FXDCWindow#end (method)">#end</a></span> will be called automatically when the block terminates.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
19
20</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXDCWindow.rb', line 19</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_drawable'>drawable</span><span class='comma'>,</span> <span class='id identifier rubyid_event'>event</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span> <span class='comment'># :yields: dc
</span><span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="begin-instance_method">
#<strong>begin</strong>(drawable) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Lock in a drawable surface.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
25</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXDCWindow.rb', line 25</span>
<span class='kw'>def</span> <span class='kw'>begin</span><span class='lparen'>(</span><span class='id identifier rubyid_drawable'>drawable</span><span class='rparen'>)</span> <span class='semicolon'>;</span> <span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="end-instance_method">
#<strong>end</strong> ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Unlock the drawable surface.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
30</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXDCWindow.rb', line 30</span>
<span class='kw'>def</span> <span class='kw'>end</span><span class='lparen'>(</span><span class='rparen'>)</span> <span class='semicolon'>;</span> <span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Mon Jan 2 11:47:40 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.28 (ruby-3.1.2).
</div>
</div>
</body>
</html>