fxruby 1.6.1 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/apes02.html +6 -6
- data/doc/apes03.html +11 -11
- data/doc/book.html +1 -1
- data/doc/build.html +63 -63
- data/doc/ch03s02.html +7 -7
- data/doc/ch03s03.html +18 -18
- data/doc/ch03s04.html +11 -11
- data/doc/ch03s05.html +14 -14
- data/doc/ch04s02.html +14 -14
- data/doc/ch04s03.html +15 -15
- data/doc/ch04s04.html +28 -28
- data/doc/ch05s02.html +49 -49
- data/doc/ch05s03.html +8 -8
- data/doc/changes.html +263 -193
- data/doc/clipboardtut.html +57 -45
- data/doc/cvs.html +10 -10
- data/doc/differences.html +4 -4
- data/doc/dragdroptut.html +50 -50
- data/doc/events.html +11 -11
- data/doc/examples.html +48 -48
- data/doc/gems.html +37 -37
- data/doc/goals.html +4 -4
- data/doc/implementation.html +4 -4
- data/doc/infosources.html +6 -6
- data/doc/library.html +19 -19
- data/doc/opengl.html +31 -31
- data/doc/pt01.html +1 -1
- data/doc/pt02.html +1 -1
- data/doc/scintilla.html +15 -15
- data/doc/style.css +3 -0
- data/doc/todo.html +5 -5
- data/doc/tutorial1.html +34 -34
- data/doc/unicode.html +56 -0
- data/ext/fox16/dialogs_wrap.cpp +38 -14
- data/ext/fox16/frames_wrap.cpp +856 -22
- data/ext/fox16/fx3d_wrap.cpp +169 -144
- data/ext/fox16/icons_wrap.cpp +24 -6
- data/ext/fox16/image_wrap.cpp +24 -6
- data/ext/fox16/label_wrap.cpp +23 -8
- data/ext/fox16/markfuncs.cpp +8 -1
- data/ext/fox16/mdi_wrap.cpp +53 -23
- data/ext/fox16/menu_wrap.cpp +43 -19
- data/ext/fox16/scintilla_wrap.cpp +31 -7
- data/ext/fox16/table_wrap.cpp +31 -7
- data/ext/fox16/text_wrap.cpp +31 -7
- data/ext/fox16/treelist_wrap.cpp +300 -276
- data/ext/fox16/ui_wrap.cpp +385 -26
- data/lib/fox16/aliases.rb +3 -0
- data/lib/fox16/version.rb +1 -1
- data/rdoc-sources/FXFoldingList.rb +2 -2
- data/tests/TC_FXDirList.rb +1 -1
- data/tests/TC_FXGLViewer.rb +2 -0
- data/tests/TC_FXHeader.rb +1 -1
- data/tests/TC_FXIconList.rb +1 -1
- data/tests/TC_FXId.rb +1 -1
- data/tests/TC_FXList.rb +1 -1
- data/tests/TC_FXListBox.rb +1 -1
- data/tests/TC_FXMenuCommand.rb +0 -14
- data/tests/TC_FXTable.rb +0 -32
- data/tests/TC_FXTableItem.rb +1 -1
- data/tests/TC_FXTreeList.rb +1 -1
- data/tests/TC_FXTreeListBox.rb +1 -1
- metadata +5 -4
data/doc/clipboardtut.html
CHANGED
@@ -1,56 +1,68 @@
|
|
1
1
|
<html><head>
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
-
<title>Chapter
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
<title>Chapter 4. Working With the Clipboard</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt01.html" title="Part I. The Basics"><link rel="prev" href="ch03s05.html" title="Adding an icon"><link rel="next" href="ch04s02.html" title="Acquiring the Clipboard"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 4. Working With the Clipboard</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03s05.html">Prev</a> </td><th width="60%" align="center">Part I. The Basics</th><td width="20%" align="right"> <a accesskey="n" href="ch04s02.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="clipboardtut"></a>Chapter 4. Working With the Clipboard</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="clipboardtut.html#d0e986">Basic Application</a></span></dt><dt><span class="section"><a href="ch04s02.html">Acquiring the Clipboard</a></span></dt><dt><span class="section"><a href="ch04s03.html">Sending Data to the Clipboard</a></span></dt><dt><span class="section"><a href="ch04s04.html">Pasting Data from the Clipboard</a></span></dt></dl></div><p>Two of the standard FOX widgets, <code class="classname">FXText</code> and
|
4
|
+
<code class="classname">FXTextField</code>, provide clipboard support out of the
|
5
|
+
box. For example, you can select some text in an
|
6
|
+
<code class="classname">FXTextField</code> and then press Ctrl+C to copy that text
|
7
|
+
to the system clipboard. You can also press Ctrl+X to "cut" the selected
|
8
|
+
text to the clipboard, or Ctrl+V to paste text from the clipboard into an
|
9
|
+
<code class="classname">FXText</code> or <code class="classname">FXTextField</code> widget.
|
10
|
+
The purpose of this tutorial is to demonstrate how to interact with the
|
11
|
+
clipboard programmatically, so that you can integrate additional clipboard
|
12
|
+
support into your FXRuby applications.</p><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e986"></a>Basic Application</h2></div></div></div><p>In order to illustrate how to integrate cut and paste operations
|
13
|
+
into your application, we'll start from a simple FXRuby application that
|
14
|
+
doesn't yet provide any clipboard support. This application simply
|
15
|
+
presents a list of customers (from some external source).</p><pre class="programlisting">require 'rubygems'
|
16
|
+
require_gem 'fxruby'
|
17
|
+
require 'customer'
|
10
18
|
|
11
19
|
include Fox
|
12
20
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
main.show(PLACEMENT_SCREEN)
|
18
|
-
application.run()
|
19
|
-
</pre></td></tr></table><p>and here's the modified version:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'fox16'
|
20
|
-
<span class="bold"><b>require 'jcode'</b></span>
|
21
|
+
class ClipMainWindow < FXMainWindow
|
22
|
+
def initialize(anApp)
|
23
|
+
# Initialize base class first
|
24
|
+
super(anApp, "Clipboard Example", nil, nil, DECOR_ALL, 0, 0, 400, 300)
|
21
25
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
# Place the list in a sunken frame
|
27
|
+
sunkenFrame = FXVerticalFrame.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK,
|
28
|
+
0, 0, 0, 0, 0, 0, 0, 0)
|
29
|
+
|
30
|
+
# Customer list
|
31
|
+
customerList = FXList.new(sunkenFrame, nil, 0, LIST_BROWSESELECT|LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
32
|
+
$customers.each do |customer|
|
33
|
+
customerList.appendItem(customer.name, nil, customer)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def create
|
38
|
+
super
|
39
|
+
show(PLACEMENT_SCREEN)
|
40
|
+
end
|
33
41
|
end
|
34
42
|
|
35
|
-
|
36
|
-
|
37
|
-
|
43
|
+
if __FILE__ == $0
|
44
|
+
FXApp.new("ClipboardExample", "FXRuby") do |theApp|
|
45
|
+
ClipMainWindow.new(theApp)
|
46
|
+
theApp.create
|
47
|
+
theApp.run
|
38
48
|
end
|
39
|
-
end
|
40
|
-
|
41
|
-
|
49
|
+
end
|
50
|
+
</pre><p>We're assuming that the "customer" module defines a
|
51
|
+
<code class="classname">Customer</code> class and a global array
|
52
|
+
<code class="varname">$customers</code> that contains the list of customers. For a
|
53
|
+
real world application, you might access this information from a database
|
54
|
+
or some other source, but for this example we'll just use a hard-coded
|
55
|
+
array:</p><pre class="programlisting"># customer.rb
|
42
56
|
|
43
|
-
|
57
|
+
Customer = Struct.new("Customer", :name, :address, :zip)
|
44
58
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
application
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
<tt class="varname">$KCODE</tt> global variable to "u", we're telling Ruby which
|
56
|
-
character encoding it is that we're using (UTF-8).</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch05s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pt01.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="examples.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Putting It All Together </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 7. Examples</td></tr></table></div></body></html>
|
59
|
+
$customers = []
|
60
|
+
$customers << Customer.new("Reed Richards", "123 Maple, Central City, NY", 010111)
|
61
|
+
$customers << Customer.new("Sue Storm", "123 Maple, Anytown, NC", 12345)
|
62
|
+
$customers << Customer.new("Benjamin J. Grimm", "123 Maple, Anytown, NC", 12345)
|
63
|
+
$customers << Customer.new("Johnny Storm", "123 Maple, Anytown, NC", 12345)
|
64
|
+
</pre><p>The goals for the next few sections are to extend this application
|
65
|
+
so that users can select a customer from the list and copy that customer's
|
66
|
+
information to the clipboard, and subsequently paste that information into
|
67
|
+
another copy of the program (or some other clipboard-aware
|
68
|
+
application).</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s05.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pt01.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch04s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Adding an icon </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Acquiring the Clipboard</td></tr></table></div></body></html>
|
data/doc/cvs.html
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
<html><head>
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
-
<title>Appendix F. Getting the Sources from CVS</title><meta name="generator" content="DocBook XSL Stylesheets V1.
|
3
|
+
<title>Appendix F. Getting the Sources from CVS</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt02.html" title="Part II. Appendices"><link rel="prev" href="apes03.html" title="Virtual Functions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix F. Getting the Sources from CVS</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apes03.html">Prev</a> </td><th width="60%" align="center">Part II. Appendices</th><td width="20%" align="right"> </td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="cvs"></a>Appendix F. Getting the Sources from CVS</h2></div></div></div><p>All of the source code for FXRuby is available for anonymous,
|
4
4
|
read-only CVS access. This chapter describes how to check out the sources
|
5
5
|
for either the stable or development release of FXRuby and then build FXRuby
|
6
6
|
from those sources. The information in this chapter builds on the basic CVS
|
@@ -19,17 +19,17 @@
|
|
19
19
|
modified SWIG interface files. I always use the latest development version
|
20
20
|
of <a href="http://www.swig.org" target="_top">SWIG</a>, but any release after,
|
21
21
|
say, SWIG 1.3.15 should work fine. The older SWIG 1.1 releases will
|
22
|
-
definitely <span class="emphasis"><em>not</em></span> work.</p><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
22
|
+
definitely <span class="emphasis"><em>not</em></span> work.</p><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5077"></a>Checking out the stable version</h2></div></div></div><p>The stable version of FXRuby is the 1.0.x branch and is compatible
|
23
23
|
with any of the FOX 1.0.x releases. It is <span class="emphasis"><em>not</em></span>
|
24
24
|
compatible with any other release branches of FOX (e.g. the FOX 1.2.x or
|
25
|
-
1.3.x series of releases).</p><p>To check out the stable version of FXRuby, do the following:</p><div class="orderedlist"><ol type="1"><li><p>Log in to the CVS server by typing:</p><
|
26
|
-
simply press the <
|
25
|
+
1.3.x series of releases).</p><p>To check out the stable version of FXRuby, do the following:</p><div class="orderedlist"><ol type="1"><li><p>Log in to the CVS server by typing:</p><pre class="screen">cvs -d:pserver:anonymous@rubyforge.org:/var/cvs/fxruby login</pre><p>When prompted for a password for <span class="emphasis"><em>anonymous</em></span>,
|
26
|
+
simply press the <span><strong class="keycap">Enter</strong></span> key.</p></li><li><p>Check out the stable branch of FXRuby by typing:</p><pre class="screen">cvs -z3 -d:pserver:anonymous@rubyforge.org:/var/cvs/fxruby co -rrelease10 FXRuby</pre></li></ol></div><p>At this point, you should be ready to change to the top-level
|
27
27
|
directory and go through the normal build and installation process, as
|
28
|
-
described in an earlier chapter.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
29
|
-
ending with a <
|
30
|
-
to re-run SWIG to regenerate parts of the FXRuby source code:</p><div class="orderedlist"><ol type="1"><li><p>Change directories to the <
|
28
|
+
described in an earlier chapter.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5110"></a>Regenerating wrapper code with SWIG</h2></div></div></div><p>If you make changes to any of the SWIG interface files (the files
|
29
|
+
ending with a <code class="filename">.i</code> extension, in the <code class="filename">swig-interfaces</code> subdirectory) you will need
|
30
|
+
to re-run SWIG to regenerate parts of the FXRuby source code:</p><div class="orderedlist"><ol type="1"><li><p>Change directories to the <code class="filename">swig-interfaces</code> subdirectory of the
|
31
31
|
FXRuby source tree.</p></li><li><p>Type the following command to create a "bootstrap"
|
32
|
-
<
|
33
|
-
sources; after that, the <
|
32
|
+
<code class="filename">dependencies</code> file:</p><pre class="screen">touch dependencies</pre><p>You should only need to do this for the initial checkout of the
|
33
|
+
sources; after that, the <code class="filename">dependencies</code> file will
|
34
34
|
be updated as described in the next step.</p></li><li><p>Build the "depend" target to generate the real
|
35
|
-
<
|
35
|
+
<code class="filename">dependencies</code> file by typing:</p><pre class="screen">make depend</pre></li><li><p>Finally, regenerate the sources by typing:</p><pre class="screen">make</pre></li></ol></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apes03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pt02.html">Up</a></td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top">Virtual Functions </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
|
data/doc/differences.html
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
<html><head>
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
-
<title>Appendix C. Differences between FOX and FXRuby</title><meta name="generator" content="DocBook XSL Stylesheets V1.
|
3
|
+
<title>Appendix C. Differences between FOX and FXRuby</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt02.html" title="Part II. Appendices"><link rel="prev" href="scintilla.html" title="Appendix B. Using Scintilla with FXRuby"><link rel="next" href="library.html" title="Appendix D. The FXRuby Standard Library"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix C. Differences between FOX and FXRuby</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="scintilla.html">Prev</a> </td><th width="60%" align="center">Part II. Appendices</th><td width="20%" align="right"> <a accesskey="n" href="library.html">Next</a></td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="differences"></a>Appendix C. Differences between FOX and FXRuby</h2></div></div></div><p>The FXRuby API follows the FOX API very closely and for the most part, you should be able to use the standard FOX class documentation as a reference. In some cases, however, fundamental differences between Ruby and C++ necessitated slight changes in the API. For some other cases, FOX classes were enhanced to take advantage of Ruby language features (such as iterators). The purpose of this chapter is to identify some of the differences between the C++ and Ruby interfaces to FOX.</p><p>One difference that should be easy to cope with is the substitution of Ruby Strings for FXStrings. Any function that would normally expect an <span class="type">FXString</span> input argument insteads takes a Ruby String. Similarly, functions that would return an <span class="type">FXString</span> will instead return a Ruby string. For functions that would normally accept a <code class="constant">NULL</code> or empty string argument, just pass <code class="constant">nil</code> or an empty string ("").</p><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4158"></a>Functions that expect arrays of objects</h2></div></div></div><p>One common pattern in FOX member function argument lists is to expect a pointer to an array of values, followed by an integer indicating the number of values in the array. This of course isn't necessary in Ruby, where <code class="classname">Array</code> objects "know" their lengths. As a result, functions such as <code class="methodname">FXWindow::acquireClipboard()</code>, whose C++ declaration looks like this:</p><pre class="programlisting">FXbool acquireClipboard(const FXDragType *types, FXuint numTypes);</pre><p>are called from Ruby code by passing in a single <code class="classname">Array</code> argument, e.g.</p><pre class="programlisting">myWindow.acquireClipboard(typesArray)</pre></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4178"></a>Functions that return values by reference</h2></div></div></div><p>Many FOX methods take advantage of the C++ language feature of returning values by reference. For example, the <code class="methodname">getCursorPos()</code> member function for class <code class="classname">FXWindow</code> has the declaration:</p><pre class="programlisting">FXint getCursorPos(FXint& x, FXint& y, FXint& buttons) const;</pre><p>which indicates that the function takes references to three integers (x, y and buttons). To call this function from a C++ program, you'd write code like this:</p><pre class="programlisting">FXint x, y;
|
4
4
|
FXuint buttons;
|
5
5
|
|
6
6
|
if (window->getCursorPosition(x, y, buttons))
|
7
|
-
fprintf(stderr, "Current position is (%d, %d)\n", x, y);</pre
|
7
|
+
fprintf(stderr, "Current position is (%d, %d)\n", x, y);</pre><p>Since this idiom doesn't translate well to Ruby, some functions' interfaces have been slightly modified. For example, the FXRuby implementation of <code class="methodname">getCursorPos()</code> returns the three values as an <code class="classname">Array</code>, e.g.:</p><pre class="programlisting">x, y, buttons = aWindow.getCursorPos()</pre><p>The following table shows how these kinds of functions are implemented in FXRuby:</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="center">Instance Method</th><th align="center">Return Value</th></tr></thead><tbody><tr><td><code class="methodname">FXDial#range</code></td><td>Returns a <code class="classname">Range</code> instance.</td></tr><tr><td><code class="methodname">FXDial#range=(aRange)</code></td><td>Accepts a <code class="classname">Range</code> instance as its input.</td></tr><tr><td><code class="methodname">FXFontDialog#fontSelection</code></td><td>Returns the <code class="classname">FXFontDesc</code> instance</td></tr><tr><td><code class="methodname">FXFontSelector#fontSelection</code></td><td>Returns the <code class="classname">FXFontDesc</code> instance</td></tr><tr><td><code class="methodname">FXGLObject#bounds(range)</code></td><td>Takes an <code class="classname">FXRange</code> instance as its input and returns a (possibly modified) <code class="classname">FXRange</code> instance.</td></tr><tr><td><code class="methodname">FXGLViewer#eyeToScreen(eye)</code></td><td>Takes an array of eye coordinates (floats) as its input and returns the screen point coordinate as an array of integers [sx, sy]</td></tr><tr><td><code class="methodname">FXGLViewer#getBoreVector(sx, sy)</code></td><td>Returns the endpoint and direction vector as an array of arrays [point, dir]</td></tr><tr><td><code class="methodname">FXGLViewer#light</code></td><td>Returns a <code class="classname">FXLight</code> instance</td></tr><tr><td><code class="methodname">FXGLViewer#viewport</code></td><td>Returns an <code class="classname">FXViewport</code> instance.</td></tr><tr><td><code class="methodname">FXPrinterDialog#printer</code></td><td>Returns the <code class="classname">FXPrinter</code> instance</td></tr><tr><td><code class="methodname">FXScrollArea#position</code></td><td>Returns the position as an array of integers [x, y]</td></tr><tr><td><code class="methodname">FXSlider#range</code></td><td>Returns a <code class="classname">Range</code> instance.</td></tr><tr><td><code class="methodname">FXSlider#range=(aRange)</code></td><td>Accepts a <code class="classname">Range</code> instance as its input.</td></tr><tr><td><code class="methodname">FXSpinner#range</code></td><td>Returns a <code class="classname">Range</code> instance.</td></tr><tr><td><code class="methodname">FXSpinner#range=(aRange)</code></td><td>Accepts a <code class="classname">Range</code> instance as its input.</td></tr><tr><td><code class="methodname">FXText#appendText(text, notify=false)</code></td><td>Append text to the end of the buffer.</td></tr><tr><td><code class="methodname">FXText#appendStyledText(text, style=0, notify=false)</code></td><td>Append styled text to the end of the buffer.</td></tr><tr><td><code class="methodname">FXText#extractText(pos, n)</code></td><td>Extracts <span class="emphasis"><em>n</em></span> characters from the buffer beginning at position <span class="emphasis"><em>pos</em></span> and returns the result as a String.</td></tr><tr><td><code class="methodname">FXText#extractStyle(pos, n)</code></td><td>Extracts <span class="emphasis"><em>n</em></span> style characters from the buffer beginning at position <span class="emphasis"><em>pos</em></span> and returns the result as a String.</td></tr><tr><td><code class="methodname">FXText#insertText(pos, text, notify=false)</code></td><td>Insert <span class="emphasis"><em>text</em></span> at position <span class="emphasis"><em>pos</em></span> in the buffer.</td></tr><tr><td><code class="methodname">FXText#insertStyledText(pos, text, style=0, notify=false)</code></td><td>Insert <span class="emphasis"><em>text</em></span> at position <span class="emphasis"><em>pos</em></span> in the buffer.</td></tr><tr><td><code class="methodname">FXText#replaceText(pos, m, text, notify=false)</code></td><td>Replace <span class="emphasis"><em>m</em></span> characters at <span class="emphasis"><em>pos</em></span> by <span class="emphasis"><em>text</em></span>.</td></tr><tr><td><code class="methodname">FXText#replaceStyledText(pos, m, text, style=0, notify=false)</code></td><td>Replace <span class="emphasis"><em>m</em></span> characters at <span class="emphasis"><em>pos</em></span> by <span class="emphasis"><em>text</em></span>.</td></tr><tr><td><code class="methodname">FXText#setDelimiters(delimiters)</code></td><td>Change delimiters of words (<span class="emphasis"><em>delimiters</em></span> is a string).</td></tr><tr><td><code class="methodname">FXText#getDelimiters()</code></td><td>Return word delimiters as a string.</td></tr><tr><td><code class="methodname">FXWindow#cursorPosition</code></td><td>Returns an array of integers [x, y, buttons]</td></tr><tr><td><code class="methodname">FXWindow#translateCoordinatesFrom(window, x, y)</code></td><td>Returns the translated coordinates as an array [x, y]</td></tr><tr><td><code class="methodname">FXWindow#translateCoordinatesTo(window, x, y)</code></td><td>Returns the translated coordinates as an array [x, y]</td></tr></tbody></table></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4468"></a>Iterators</h2></div></div></div><p>Several classes have been extended with an <code class="methodname">each</code> method to provide Ruby-style iterators. These classes include <code class="classname">FXComboBox</code>, <code class="classname">FXGLGroup</code>, <code class="classname">FXHeader</code>, <code class="classname">FXIconList</code>, <code class="classname">FXList</code>, <code class="classname">FXListBox</code>, <code class="classname">FXTreeItem</code>, <code class="classname">FXTreeList</code> and <code class="classname">FXTreeListBox</code>. These classes also mix-in Ruby's <code class="classname">Enumerable</code> module so that you can take full advantage of the iterators.</p><p>The block parameters passed to your code block vary depending on the class. For example, iterating over an <code class="classname">FXList</code> instance yields <code class="classname">FXListItem</code> parameters:</p><pre class="programlisting">aList.each { |aListItem|
|
8
8
|
puts "text for this item = #{aListItem.getText()}"
|
9
|
-
}</pre
|
9
|
+
}</pre><p>whereas iterating over an <code class="classname">FXComboBox</code> instance yields two parameters, the item text (a string) and the item data:</p><pre class="programlisting">aComboBox.each { |itemText, itemData|
|
10
10
|
puts "text for this item = #{itemText}"
|
11
|
-
}</pre
|
11
|
+
}</pre><p>The following table shows the block parameters for each of these classes' iterators:</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="center">Class</th><th align="center">Block Parameters</th></tr></thead><tbody><tr><td><code class="classname">FXComboBox</code></td><td>the item text (a string) and user data</td></tr><tr><td><code class="classname">FXGLGroup</code></td><td>an <code class="classname">FXGLObject</code> instance</td></tr><tr><td><code class="classname">FXHeader</code></td><td>an <code class="classname">FXHeaderItem</code> instance</td></tr><tr><td><code class="classname">FXIconList</code></td><td>an <code class="classname">FXIconItem</code> instance</td></tr><tr><td><code class="classname">FXList</code></td><td>an <code class="classname">FXListItem</code> instance</td></tr><tr><td><code class="classname">FXListBox</code></td><td>the item text (a string), icon (an <code class="classname">FXIcon</code> instance) and user data</td></tr><tr><td><code class="classname">FXTreeItem</code></td><td>an <code class="classname">FXTreeItem</code> instance</td></tr><tr><td><code class="classname">FXTreeList</code></td><td>an <code class="classname">FXTreeItem</code> instance</td></tr><tr><td><code class="classname">FXTreeListBox</code></td><td>an <code class="classname">FXTreeItem</code> instance</td></tr></tbody></table></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4612"></a>Attribute Accessors</h2></div></div></div><p>FOX strictly handles access to all object attributes through member functions, e.g. <code class="methodname">setBackgroundColor</code> and <code class="methodname">getBackgroundColor</code> or <code class="methodname">setText</code> and <code class="methodname">getText</code>. FXRuby exposes all of these functions but also provides aliases that look more like regular Ruby attribute accessors. The names for these accessors are based on the FOX method names; for example, <code class="methodname">setBackgroundColor</code> and <code class="methodname">getBackgroundColor</code> are aliased to <code class="methodname">backgroundColor=</code> and <code class="methodname">backgroundColor</code>, respectively.</p><p>In many cases these aliases allow you to write more compact and legible code. For example, consider this code snippet:</p><pre class="programlisting">aLabel.setText(aLabel.getText() + " (modified)")</pre><p>Now consider a different code snippet, using the aliased accessor method names:</p><pre class="programlisting">aLabel.text += " (modified)"</pre><p>While these two are functionally equivalent, the latter is a bit easier to read and understand at first glance.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4651"></a>Message Passing</h2></div></div></div><p>FOX message maps are implemented as static C++ class members. With FXRuby, you just associate messages with message handlers in the class <code class="methodname">initialize</code> method using the <code class="methodname">FXMAPFUNC()</code>, <code class="methodname">FXMAPTYPE()</code>, <code class="methodname">FXMAPTYPES()</code> or <code class="methodname">FXMAPFUNCS()</code> methods. See almost any of the example programs for examples of how this is done.</p><p>As in C++ FOX, the last argument passed to your message handler functions contains message-specific data. For instance, all <code class="constant">SEL_PAINT</code> messages pass an <code class="classname">FXEvent</code> object through this argument to give you some information about the size of the exposed rectangle. On the other hand, a <code class="constant">SEL_COMMAND</code> message from an <code class="classname">FXHeader</code> object passes the index of the selected header item through this argument. Instead of guessing what's in this last argument, your best bet is to instead invoke a member function on the sending object to find out what you need, instead of relying on the data passed through this pointer. For example, if you get a <code class="constant">SEL_COMMAND</code> message from an <code class="classname">FXColorWell</code> object, the data passed through that last argument is supposed to be the new RGB color value. Instead of trying to interpret the argument's contents, just turn around and call the color well's <code class="methodname">getRGBA()</code> member function to retrieve its color. Similarly, if you get a <code class="constant">SEL_COMMAND</code> message from a tree list, call its <code class="methodname">getCurrentItem()</code> method to find out which item was selected.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4700"></a>Catching Operating System Signals</h2></div></div></div><p>The <code class="methodname">FXApp#addSignal</code> and <code class="methodname">FXApp#removeSignal</code> methods have been enhanced to accept either a string or integer as their first argument. If it's a string (e.g. "SIGINT" or just "INT") the code will determine the corresponding signal number for you (similar to the standard Ruby library's <code class="methodname">Process.kill</code> module method). For examples of how to use this, see the <code class="filename">datatarget.rb</code> or <code class="filename">imageviewer.rb</code> example programs.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4720"></a>Support for Multithreaded Applications</h2></div></div></div><p>There is some support for multithreaded FXRuby applications, but it's not wonderful. The current implementation does what is also done in Ruby/GTK; it turns over some idle processing time to the Ruby thread scheduler to let other threads do their thing. As I learn more about Ruby's threading implementation I may try something different, but this seems to work OK for now. For a simple example, see the <code class="filename">groupbox.rb</code> example program, in which the clock label that appears in the lower right-hand corner is continuously updated (by a separate thread).</p><p>If you suspect that FXRuby's threads support is interfering with your application's performance, you may want to try tweaking the amount of time that the main application thread "sleeps" during idle processing; do this by setting the <code class="classname">FXApp</code> object's <em class="structfield"><code>sleepTime</code></em> attribute. The default value for <em class="structfield"><code>FXApp#sleepTime</code></em> is 100 milliseconds. You can also disable the threads support completely by calling <code class="methodname">FXApp#threadsEnabled=false</code> (and subsequently re-enable it with <code class="methodname">FXApp#threadsEnabled=true</code>).</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4745"></a>Debugging Tricks</h2></div></div></div><p>As a debugging tool, you can optionally catch exceptions raised in message handlers. To turn on this feature, call the <code class="methodname">setIgnoreExceptions(true)</code> module method. When this is enabled, any exceptions raised in message handler functions will cause a standard stack trace to be dumped to the standard output, but then your application will, for better or worse, proceed normally. Thanks to Ted Meng for this suggestion.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="scintilla.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pt02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="library.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix B. Using Scintilla with FXRuby </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix D. The FXRuby Standard Library</td></tr></table></div></body></html>
|
data/doc/dragdroptut.html
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
<html><head>
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
-
<title>Chapter 5. Drag and Drop</title><meta name="generator" content="DocBook XSL Stylesheets V1.
|
3
|
+
<title>Chapter 5. Drag and Drop</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt01.html" title="Part I. The Basics"><link rel="prev" href="ch04s04.html" title="Pasting Data from the Clipboard"><link rel="next" href="ch05s02.html" title="Drag Sources"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. Drag and Drop</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch04s04.html">Prev</a> </td><th width="60%" align="center">Part I. The Basics</th><td width="20%" align="right"> <a accesskey="n" href="ch05s02.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="dragdroptut"></a>Chapter 5. Drag and Drop</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="dragdroptut.html#d0e1201">Drop Sites</a></span></dt><dt><span class="section"><a href="ch05s02.html">Drag Sources</a></span></dt><dt><span class="section"><a href="ch05s03.html">Putting It All Together</a></span></dt></dl></div><p>One of the more powerful features available to FOX applications is
|
4
4
|
drag-and-drop. It's also one of the more complicated to understand. For more
|
5
5
|
background, see the standard FOX documentation on <a href="http://www.fox-toolkit.com/draganddrop.html" target="_top">Drag and
|
6
|
-
Drop</a>.</p><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1201"></a>Drop Sites</h2></div></div
|
7
|
-
of a main window widget (a <
|
8
|
-
parents an <
|
6
|
+
Drop</a>.</p><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1201"></a>Drop Sites</h2></div></div></div><p>We're going to start by presenting a skeleton application consisting
|
7
|
+
of a main window widget (a <code class="classname">DropSite</code> instance) that
|
8
|
+
parents an <code class="classname">FXCanvas</code> widget:</p><pre class="programlisting">require 'rubygems'
|
9
9
|
require_gem 'fxruby'
|
10
10
|
|
11
11
|
include Fox
|
@@ -35,13 +35,13 @@ if __FILE__ == $0
|
|
35
35
|
theApp.run
|
36
36
|
end
|
37
37
|
end
|
38
|
-
</pre
|
38
|
+
</pre><p>Since the main program (i.e. the part at the end) won't change for
|
39
39
|
the rest of the tutorial, I won't show that code anymore. Since an
|
40
|
-
<
|
40
|
+
<code class="classname">FXCanvas</code> widget relies on some other object (its
|
41
41
|
message target) to draw its contents, we need to handle
|
42
|
-
<
|
42
|
+
<code class="constant">SEL_PAINT</code> messages generated by the canvas. We'll do
|
43
43
|
that by adding a handler that clears the canvas to its current background
|
44
|
-
color:</p><
|
44
|
+
color:</p><pre class="programlisting">require 'rubygems'
|
45
45
|
require_gem 'fxruby'
|
46
46
|
|
47
47
|
include Fox
|
@@ -54,13 +54,13 @@ class DropSite < FXMainWindow
|
|
54
54
|
# Fill main window with canvas
|
55
55
|
@canvas = FXCanvas.new(self, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
56
56
|
|
57
|
-
<span class="bold"><
|
57
|
+
<span class="bold"><strong> # Handle expose events on the canvas
|
58
58
|
@canvas.connect(SEL_PAINT) { |sender, sel, event|
|
59
59
|
FXDCWindow.new(@canvas, event) { |dc|
|
60
60
|
dc.foreground = @canvas.backColor
|
61
61
|
dc.fillRectangle(event.rect.x, event.rect.y, event.rect.w, event.rect.h)
|
62
62
|
}
|
63
|
-
}</
|
63
|
+
}</strong></span>
|
64
64
|
end
|
65
65
|
|
66
66
|
def create
|
@@ -71,14 +71,14 @@ class DropSite < FXMainWindow
|
|
71
71
|
show(PLACEMENT_SCREEN)
|
72
72
|
end
|
73
73
|
end
|
74
|
-
</pre
|
74
|
+
</pre><p>Run this basic version of the program to be sure that it's working
|
75
75
|
properly so far. You should simply see an empty window with a white
|
76
76
|
background.</p><p>Now, on to the fun stuff. Our goal is to be able to drag color data
|
77
|
-
from some other window, such as an <
|
77
|
+
from some other window, such as an <code class="classname">FXColorWell</code>
|
78
78
|
widget, and drop it onto the canvas in order to change the canvas'
|
79
79
|
background color. In order for a FOX widget to be able to accept drops at
|
80
|
-
all, we need to first call its <
|
81
|
-
method:</p><
|
80
|
+
all, we need to first call its <code class="methodname">dropEnable()</code>
|
81
|
+
method:</p><pre class="programlisting">def initialize(anApp)
|
82
82
|
# Initialize base class
|
83
83
|
super(anApp, "Drop Site", nil, nil, DECOR_ALL, 0, 0, 400, 300)
|
84
84
|
|
@@ -93,10 +93,10 @@ end
|
|
93
93
|
}
|
94
94
|
}
|
95
95
|
|
96
|
-
<span class="bold"><
|
96
|
+
<span class="bold"><strong> # Enable canvas for drag-and-drop messages
|
97
97
|
@canvas.dropEnable
|
98
|
-
</
|
99
|
-
</pre
|
98
|
+
</strong></span>end
|
99
|
+
</pre><p>At this point, let's try a little test to see if the program does
|
100
100
|
anything interesting yet. Start by running some other FOX or FXRuby
|
101
101
|
program to use as a drag source for the color data. You should be able to
|
102
102
|
use any program that displays an FXColorWell widget, and this includes the
|
@@ -106,15 +106,15 @@ end
|
|
106
106
|
and try to drag a color from one of these color wells onto this window. At
|
107
107
|
this point, the mouse pointer should turn into a stop sign, indicating
|
108
108
|
that the canvas isn't accepting drops of color data yet.</p><p>To correct this problem, we need to use the canvas'
|
109
|
-
<
|
109
|
+
<code class="methodname">acceptDrop()</code> method to indicate whether or not
|
110
110
|
we'll accept certain kinds of drops. You can call
|
111
|
-
<
|
112
|
-
<
|
113
|
-
response to a <
|
114
|
-
handler for <
|
111
|
+
<code class="methodname">acceptDrop()</code> any time after receiving the initial
|
112
|
+
<code class="constant">SEL_DND_ENTER</code> message, but it's usually done in
|
113
|
+
response to a <code class="constant">SEL_DND_MOTION</code> message. Let's add a
|
114
|
+
handler for <code class="constant">SEL_DND_MOTION</code> messages from the canvas
|
115
115
|
in DropSite's initialize() method. For now, we'll unconditionally accept
|
116
116
|
drops from any drag source, regardless of what kind of data they're
|
117
|
-
offering:</p><
|
117
|
+
offering:</p><pre class="programlisting">def initialize(anApp)
|
118
118
|
# Initialize base class
|
119
119
|
super(anApp, "Drop Site", nil, nil, DECOR_ALL, 0, 0, 400, 300)
|
120
120
|
|
@@ -132,13 +132,13 @@ end
|
|
132
132
|
# Enable canvas for drag-and-drop messages
|
133
133
|
@canvas.dropEnable
|
134
134
|
|
135
|
-
<span class="bold"><
|
135
|
+
<span class="bold"><strong> # Handle SEL_DND_MOTION messages from the canvas
|
136
136
|
@canvas.connect(SEL_DND_MOTION) {
|
137
137
|
# Accept drops unconditionally (for now)
|
138
138
|
@canvas.acceptDrop
|
139
139
|
}
|
140
|
-
</
|
141
|
-
</pre
|
140
|
+
</strong></span>end
|
141
|
+
</pre><p>Now try the previous test again. This time, when you try to drag
|
142
142
|
from a color well to the drop-enabled canvas, you should see the mouse
|
143
143
|
pointer turn into a small filled square. This is a visual cue to the user
|
144
144
|
indicating that the canvas will accept a drop of the drag-and-drop
|
@@ -152,35 +152,35 @@ end
|
|
152
152
|
types for any kind of application-specific data that you need; but for
|
153
153
|
now, we're going to use FOX's built-in drag type for color data.</p><p>Drag types (even the standard ones) must be registered before they
|
154
154
|
can be used, and so we'll start by adding a few lines to
|
155
|
-
<
|
156
|
-
to register the drag type for color data:</p><
|
155
|
+
<code class="classname">DropSite</code>'s <code class="methodname">create()</code> method
|
156
|
+
to register the drag type for color data:</p><pre class="programlisting">def create
|
157
157
|
# Create the main window and canvas
|
158
158
|
super
|
159
159
|
|
160
|
-
<span class="bold"><
|
160
|
+
<span class="bold"><strong> # Register the drag type for colors
|
161
161
|
FXWindow.colorType = getApp().registerDragType(FXWindow.colorTypeName)
|
162
162
|
|
163
|
-
</
|
163
|
+
</strong></span> # Show the main window
|
164
164
|
show(PLACEMENT_SCREEN)
|
165
165
|
end
|
166
|
-
</pre
|
167
|
-
<
|
168
|
-
drag type name (such as <
|
166
|
+
</pre><p>Note that the first time that
|
167
|
+
<code class="methodname">registerDragType()</code> is called for a particular
|
168
|
+
drag type name (such as <code class="methodname">FXWindow.colorTypeName</code>)
|
169
169
|
it will generate a unique identifier for that drag type. Subsequent calls
|
170
|
-
to <
|
170
|
+
to <code class="methodname">registerDragType()</code> for the same drag type name
|
171
171
|
will just return the previously-generated drag type. Now, we want to
|
172
|
-
modify our <
|
173
|
-
little more picky about which kinds of drops it will accept:</p><
|
172
|
+
modify our <code class="constant">SEL_DND_MOTION</code> handler so that it's a
|
173
|
+
little more picky about which kinds of drops it will accept:</p><pre class="programlisting"># Handle SEL_DND_MOTION messages from the canvas
|
174
174
|
@canvas.connect(SEL_DND_MOTION) {
|
175
|
-
<span class="bold"><
|
175
|
+
<span class="bold"><strong> if @canvas.offeredDNDType?(FROM_DRAGNDROP, FXWindow.colorType)
|
176
176
|
@canvas.acceptDrop
|
177
177
|
end
|
178
|
-
</
|
179
|
-
</pre
|
178
|
+
</strong></span>}
|
179
|
+
</pre><p>Here, we call the canvas' <code class="methodname">offeredDNDType?</code>
|
180
180
|
method to ask if the drag source can provide its data in the requested
|
181
|
-
format. Only if <
|
182
|
-
we call <
|
183
|
-
handler for the <
|
181
|
+
format. Only if <code class="methodname">offeredDNDType?</code> returns true will
|
182
|
+
we call <code class="methodname">acceptDrop()</code> as before.</p><p>The last step is to actually handle the drop, and for that we add a
|
183
|
+
handler for the <code class="constant">SEL_DND_DROP</code> message:</p><pre class="programlisting"><span class="bold"><strong># Handle SEL_DND_DROP message from the canvas
|
184
184
|
@canvas.connect(SEL_DND_DROP) {
|
185
185
|
# Try to obtain the data as color values first
|
186
186
|
data = @canvas.getDNDData(FROM_DRAGNDROP, FXWindow.colorType)
|
@@ -188,21 +188,21 @@ end
|
|
188
188
|
# Update canvas background color
|
189
189
|
@canvas.backColor = Fox.fxdecodeColorData(data)
|
190
190
|
end
|
191
|
-
}</
|
192
|
-
requested format, the <
|
191
|
+
}</strong></span></pre><p>Assuming that the drag source is able to provide its data in the
|
192
|
+
requested format, the <code class="methodname">getDNDData()</code> method will
|
193
193
|
return a String (which for our purposes is just a byte buffer). If you've
|
194
194
|
defined your own application-specific drag types, this data can of course
|
195
195
|
be anything, and we'll see examples of this in a later tutorial. But the
|
196
196
|
data for standard drag types like
|
197
|
-
<
|
197
|
+
<code class="methodname">FXWindow.colorType</code> can be decoded using the
|
198
198
|
appropriate built-in library functions. In this case, we use the
|
199
|
-
<
|
199
|
+
<code class="methodname">fxdecodeColorData()</code> method to convert the bytes
|
200
200
|
into a color value that we can use.</p><p>Now comes the moment of truth. Try running your test program again
|
201
201
|
(one that displays a color well). Now, when you drag a color from a color
|
202
|
-
well and drop it onto the <
|
202
|
+
well and drop it onto the <code class="classname">DropSite</code> window, the
|
203
203
|
canvas should change its background color accordingly.</p><p>The complete program is listed below, and is included in the
|
204
|
-
<
|
205
|
-
name <
|
204
|
+
<code class="filename">examples</code> directory under the file
|
205
|
+
name <code class="filename">dropsite.rb</code>.</p><pre class="programlisting">require 'rubygems'
|
206
206
|
require_gem 'fxruby'
|
207
207
|
|
208
208
|
include Fox
|
@@ -263,4 +263,4 @@ if __FILE__ == $0
|
|
263
263
|
theApp.run
|
264
264
|
end
|
265
265
|
end
|
266
|
-
</pre></
|
266
|
+
</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04s04.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pt01.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch05s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Pasting Data from the Clipboard </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Drag Sources</td></tr></table></div></body></html>
|