fxruby 1.6.11 → 1.6.12

Sign up to get free protection for your applications and to get access to all the features.
data/doc/pt02.html CHANGED
@@ -1,3 +1,3 @@
1
1
  <html><head>
2
2
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
3
- <title>Part&nbsp;II.&nbsp;Appendices</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook v5 XSL Stylesheets V1.72.0"><link rel="start" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="prev" href="changes.html" title="Chapter&nbsp;10.&nbsp;Change History"><link rel="next" href="opengl.html" title="Appendix&nbsp;A.&nbsp;Using OpenGL with FXRuby"></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">Part&nbsp;II.&nbsp;Appendices</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="changes.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="opengl.html">Next</a></td></tr></table><hr></div><div class="part" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="d0e4298"></a>Part&nbsp;II.&nbsp;Appendices</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="appendix"><a href="opengl.html">A. Using OpenGL with FXRuby</a></span></dt><dt><span class="appendix"><a href="scintilla.html">B. Using Scintilla with FXRuby</a></span></dt><dt><span class="appendix"><a href="differences.html">C. Differences between FOX and FXRuby</a></span></dt><dt><span class="appendix"><a href="library.html">D. The FXRuby Standard Library</a></span></dt><dt><span class="appendix"><a href="implementation.html">E. Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="implementation.html#d0e5349">Code Generation</a></span></dt><dt><span class="section"><a href="apes02.html">Object Life Cycles and Garbage Collection</a></span></dt><dd><dl><dt><span class="section"><a href="apes02.html#d0e5387">GL Objects</a></span></dt></dl></dd><dt><span class="section"><a href="apes03.html">Virtual Functions</a></span></dt></dl></dd><dt><span class="appendix"><a href="subversion.html">F. Getting the Sources from Subversion</a></span></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="changes.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="opengl.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;10.&nbsp;Change History&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Appendix&nbsp;A.&nbsp;Using OpenGL with FXRuby</td></tr></table></div></body></html>
3
+ <title>Part&nbsp;II.&nbsp;Appendices</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook v5 XSL Stylesheets V1.72.0"><link rel="start" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="prev" href="changes.html" title="Chapter&nbsp;10.&nbsp;Change History"><link rel="next" href="opengl.html" title="Appendix&nbsp;A.&nbsp;Using OpenGL with FXRuby"></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">Part&nbsp;II.&nbsp;Appendices</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="changes.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="opengl.html">Next</a></td></tr></table><hr></div><div class="part" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="d0e4392"></a>Part&nbsp;II.&nbsp;Appendices</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="appendix"><a href="opengl.html">A. Using OpenGL with FXRuby</a></span></dt><dt><span class="appendix"><a href="scintilla.html">B. Using Scintilla with FXRuby</a></span></dt><dt><span class="appendix"><a href="differences.html">C. Differences between FOX and FXRuby</a></span></dt><dt><span class="appendix"><a href="library.html">D. The FXRuby Standard Library</a></span></dt><dt><span class="appendix"><a href="implementation.html">E. Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="implementation.html#d0e5443">Code Generation</a></span></dt><dt><span class="section"><a href="apes02.html">Object Life Cycles and Garbage Collection</a></span></dt><dd><dl><dt><span class="section"><a href="apes02.html#d0e5481">GL Objects</a></span></dt></dl></dd><dt><span class="section"><a href="apes03.html">Virtual Functions</a></span></dt></dl></dd><dt><span class="appendix"><a href="subversion.html">F. Getting the Sources from Subversion</a></span></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="changes.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="opengl.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;10.&nbsp;Change History&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Appendix&nbsp;A.&nbsp;Using OpenGL with FXRuby</td></tr></table></div></body></html>
data/doc/scintilla.html CHANGED
@@ -1,12 +1,12 @@
1
1
  <html><head>
2
2
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
3
- <title>Appendix&nbsp;B.&nbsp;Using Scintilla with FXRuby</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook v5 XSL Stylesheets V1.72.0"><link rel="start" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt02.html" title="Part&nbsp;II.&nbsp;Appendices"><link rel="prev" href="opengl.html" title="Appendix&nbsp;A.&nbsp;Using OpenGL with FXRuby"><link rel="next" href="differences.html" title="Appendix&nbsp;C.&nbsp;Differences between FOX and FXRuby"></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&nbsp;B.&nbsp;Using Scintilla with FXRuby</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="opengl.html">Prev</a>&nbsp;</td><th width="60%" align="center">Part&nbsp;II.&nbsp;Appendices</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="differences.html">Next</a></td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="scintilla"></a>Appendix&nbsp;B.&nbsp;Using Scintilla with FXRuby</h2></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4486"></a>What is Scintilla?</h2></div></div></div><p><a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.scintilla.org" target="_top">Scintilla</a> is a free
3
+ <title>Appendix&nbsp;B.&nbsp;Using Scintilla with FXRuby</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook v5 XSL Stylesheets V1.72.0"><link rel="start" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt02.html" title="Part&nbsp;II.&nbsp;Appendices"><link rel="prev" href="opengl.html" title="Appendix&nbsp;A.&nbsp;Using OpenGL with FXRuby"><link rel="next" href="differences.html" title="Appendix&nbsp;C.&nbsp;Differences between FOX and FXRuby"></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&nbsp;B.&nbsp;Using Scintilla with FXRuby</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="opengl.html">Prev</a>&nbsp;</td><th width="60%" align="center">Part&nbsp;II.&nbsp;Appendices</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="differences.html">Next</a></td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="scintilla"></a>Appendix&nbsp;B.&nbsp;Using Scintilla with FXRuby</h2></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4580"></a>What is Scintilla?</h2></div></div></div><p><a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.scintilla.org" target="_top">Scintilla</a> is a free
4
4
  source code editing component developed by Neil Hodgson for the Win32 and
5
- GTK+ platforms.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4493"></a>What is FXScintilla?</h2></div></div></div><p><a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://savannah.gnu.org/projects/fxscintilla" target="_top">FXScintilla </a> is
5
+ GTK+ platforms.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4587"></a>What is FXScintilla?</h2></div></div></div><p><a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://savannah.gnu.org/projects/fxscintilla" target="_top">FXScintilla </a> is
6
6
  a FOX widget that wraps around the Scintilla component, or, if you wish,
7
7
  the FOX "port" of Scintilla. Until recently it was developed by Gilles Filippini,
8
8
  and as of this writing the latest release is available for download from
9
- <a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://download.savannah.gnu.org/releases/fxscintilla/fxscintilla-1.71.tar.gz" target="_top">http://download.savannah.gnu.org/releases/fxscintilla/fxscintilla-1.71.tar.gz</a>.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4503"></a>Compiling FXScintilla</h2></div></div></div><p>The FXScintilla distribution contains everything you need to build
9
+ <a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://download.savannah.gnu.org/releases/fxscintilla/fxscintilla-1.71.tar.gz" target="_top">http://download.savannah.gnu.org/releases/fxscintilla/fxscintilla-1.71.tar.gz</a>.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4597"></a>Compiling FXScintilla</h2></div></div></div><p>The FXScintilla distribution contains everything you need to build
10
10
  the FXScintilla widget and begin using it in your C++-based FOX
11
11
  applications. That is to say, you do not have to separately download the
12
12
  Scintilla source code from the Scintilla home page. When you unpack the
@@ -17,7 +17,7 @@
17
17
  other open-source software (like FOX) from the source code. The
18
18
  <code class="filename">INSTALL</code> file in the top-level directory should
19
19
  provide enough instruction for you to build and install FXScintilla for
20
- either Unix or Microsoft Windows.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4516"></a>Enabling FXScintilla Support in FXRuby</h2></div></div></div><p>The next step is to build a version of FXRuby (from its source code)
20
+ either Unix or Microsoft Windows.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4610"></a>Enabling FXScintilla Support in FXRuby</h2></div></div></div><p>The next step is to build a version of FXRuby (from its source code)
21
21
  with the optional FXScintilla support enabled. If you're working on a Unix
22
22
  or Linux system and have installed FXScintilla in one of the standard
23
23
  installation directories (e.g. under <code class="filename">/usr/include</code> or <code class="filename">/usr/local/include</code>), the regular FXRuby build
data/doc/subversion.html CHANGED
@@ -14,7 +14,7 @@
14
14
  <a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://svnbook.red-bean.com/" target="_top">book</a>.</p><p>You're also going to need to have a working <a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.swig.org/" target="_top">SWIG</a> installation so that you can
15
15
  generate the C++ source files from the SWIG interface files. As of this
16
16
  writing, FXRuby requires SWIG version 1.3.22; later versions of SWIG will
17
- not work, nor will versions earlier than about 1.3.15.</p><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5532"></a>Checking out the code</h2></div></div></div><p>To check out the development version (i.e. the trunk) for FXRuby,
17
+ not work, nor will versions earlier than about 1.3.15.</p><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5626"></a>Checking out the code</h2></div></div></div><p>To check out the development version (i.e. the trunk) for FXRuby,
18
18
  type the following command:</p><pre class="screen">svn checkout svn://rubyforge.org/var/svn/fxruby/trunk/FXRuby</pre><p>Next, you'll need to use SWIG to generate the C++ source code from
19
19
  the SWIG interface files. To do that, type:</p><pre class="screen">rake swig</pre><p>At this point, you should be ready to change to the top-level
20
20
  directory and go through the normal build and installation process, as
data/examples/gltest.rb CHANGED
@@ -21,26 +21,6 @@ class GLTestWindow < FXMainWindow
21
21
  # How often our timer will fire (in milliseconds)
22
22
  TIMER_INTERVAL = 100
23
23
 
24
- # Rotate the boxes when a timer message is received
25
- def onTimeout(sender, sel, ptr)
26
- @angle += 2.0
27
- if @angle > 360.0
28
- @angle -= 360.0
29
- end
30
- drawScene()
31
- @timer = getApp().addTimeout(TIMER_INTERVAL, method(:onTimeout))
32
- end
33
-
34
- # Rotate the boxes when a chore message is received
35
- def onChore(sender, sel, ptr)
36
- @angle += 2.0
37
- if @angle > 360.0
38
- @angle -= 360.0
39
- end
40
- drawScene()
41
- @chore = getApp().addChore(method(:onChore))
42
- end
43
-
44
24
  # Draws a simple box using the given corners
45
25
  def drawBox(xmin, ymin, zmin, xmax, ymax, zmax)
46
26
  GL.Begin(GL::TRIANGLE_STRIP)
@@ -250,7 +230,13 @@ class GLTestWindow < FXMainWindow
250
230
  spinTimerBtn.padTop, spinTimerBtn.padBottom = 5, 5
251
231
  spinTimerBtn.connect(SEL_COMMAND) do
252
232
  @spinning = true
253
- @timer = getApp().addTimeout(TIMER_INTERVAL, method(:onTimeout))
233
+ @timer = getApp().addTimeout(TIMER_INTERVAL, :repeat => true) do
234
+ @angle += 2.0
235
+ if @angle > 360.0
236
+ @angle -= 360.0
237
+ end
238
+ drawScene()
239
+ end
254
240
  end
255
241
  spinTimerBtn.connect(SEL_UPDATE) do |sender, sel, ptr|
256
242
  @spinning ? sender.disable : sender.enable
@@ -265,7 +251,13 @@ class GLTestWindow < FXMainWindow
265
251
  spinChoreBtn.padTop, spinChoreBtn.padBottom = 5, 5
266
252
  spinChoreBtn.connect(SEL_COMMAND) do
267
253
  @spinning = true
268
- @chore = getApp().addChore(method(:onChore))
254
+ @chore = getApp().addChore(:repeat => true) do
255
+ @angle += 2.0
256
+ if @angle > 360.0
257
+ @angle -= 360.0
258
+ end
259
+ drawScene()
260
+ end
269
261
  end
270
262
  spinChoreBtn.connect(SEL_UPDATE) do |sender, sel, ptr|
271
263
  @spinning ? sender.disable : sender.enable
@@ -86,7 +86,7 @@ class ImageWindow < FXMainWindow
86
86
  # Make file list
87
87
  fileframe = FXHorizontalFrame.new(@filebox,
88
88
  FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X|LAYOUT_FILL_Y,
89
- :padLeft => 0, :padRight => 0, :padTop => 0, :padBottom => 0. :hSpacing => 0, :vSpacing => 0)
89
+ :padLeft => 0, :padRight => 0, :padTop => 0, :padBottom => 0, :hSpacing => 0, :vSpacing => 0)
90
90
  @filelist = FXFileList.new(fileframe,
91
91
  :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|ICONLIST_MINI_ICONS|ICONLIST_AUTOSIZE)
92
92
  @filelist.connect(SEL_DOUBLECLICKED, method(:onCmdFileList))
data/examples/inputs.rb CHANGED
@@ -54,7 +54,7 @@ class InputHandlerWindow < FXMainWindow
54
54
  getApp().addInput(@pipe, INPUT_READ|INPUT_EXCEPT) do |sender, sel, ptr|
55
55
  case FXSELTYPE(sel)
56
56
  when SEL_IO_READ
57
- text = @pipe.read
57
+ text = @pipe.read_nonblock(256)
58
58
  if text && text.length > 0
59
59
  @cmdOutput.appendText(text)
60
60
  else
@@ -40,24 +40,14 @@ class StyledTextWindow < FXMainWindow
40
40
  TEXT_READONLY|TEXT_WORDWRAP|LAYOUT_FILL_X|LAYOUT_FILL_Y)
41
41
 
42
42
  # Construct some hilite styles
43
- hs1 = FXHiliteStyle.new
43
+ hs1 = FXHiliteStyle.from_text(text)
44
44
  hs1.normalForeColor = FXColor::Red
45
45
  hs1.normalBackColor = FXColor::Blue
46
- hs1.selectForeColor = text.selTextColor
47
- hs1.selectBackColor = text.selBackColor
48
- hs1.hiliteForeColor = text.hiliteTextColor
49
- hs1.hiliteBackColor = text.hiliteBackColor
50
- hs1.activeBackColor = text.activeBackColor
51
- hs1.style = 0
46
+ hs1.style = FXText::STYLE_BOLD
52
47
 
53
- hs2 = FXHiliteStyle.new
48
+ hs2 = FXHiliteStyle.from_text(text)
54
49
  hs2.normalForeColor = FXColor::Blue
55
50
  hs2.normalBackColor = FXColor::Yellow
56
- hs2.selectForeColor = text.selTextColor
57
- hs2.selectBackColor = text.selBackColor
58
- hs2.hiliteForeColor = text.hiliteTextColor
59
- hs2.hiliteBackColor = text.hiliteBackColor
60
- hs2.activeBackColor = text.activeBackColor
61
51
  hs2.style = FXText::STYLE_UNDERLINE
62
52
 
63
53
  # Enable the style buffer for this text widget
data/ext/fox16/FXRuby.cpp CHANGED
@@ -21,7 +21,7 @@
21
21
  ***********************************************************************/
22
22
 
23
23
  /***********************************************************************
24
- * $Id: FXRuby.cpp 2643 2007-04-05 03:22:03Z lyle $
24
+ * $Id: FXRuby.cpp 2689 2007-06-30 04:10:18Z lyle $
25
25
  ***********************************************************************/
26
26
 
27
27
  #ifdef _MSC_VER
@@ -1672,145 +1672,144 @@ FXbool FXRbGLViewer::sortProc(FXfloat*& buffer,FXint& used,FXint& size){
1672
1672
 
1673
1673
  //----------------------------------------------------------------------
1674
1674
 
1675
- // Copied from the Ruby 1.6.6 sources (signal.c)
1675
+ // Copied from the Ruby 1.8.6 sources (signal.c)
1676
1676
  static struct signals {
1677
- const char* signm;
1678
- FXint signo;
1679
- } siglist[]={
1677
+ char *signm;
1678
+ int signo;
1679
+ } siglist [] = {
1680
+ {"EXIT", 0},
1680
1681
  #ifdef SIGHUP
1681
- { "HUP", SIGHUP },
1682
- #endif
1683
- #ifdef SIGINT
1684
- { "INT", SIGINT },
1682
+ {"HUP", SIGHUP},
1685
1683
  #endif
1684
+ {"INT", SIGINT},
1686
1685
  #ifdef SIGQUIT
1687
- { "QUIT", SIGQUIT },
1686
+ {"QUIT", SIGQUIT},
1688
1687
  #endif
1689
1688
  #ifdef SIGILL
1690
- { "ILL", SIGILL },
1689
+ {"ILL", SIGILL},
1691
1690
  #endif
1692
1691
  #ifdef SIGTRAP
1693
- { "TRAP", SIGTRAP },
1692
+ {"TRAP", SIGTRAP},
1694
1693
  #endif
1695
1694
  #ifdef SIGIOT
1696
- { "IOT", SIGIOT },
1695
+ {"IOT", SIGIOT},
1697
1696
  #endif
1698
1697
  #ifdef SIGABRT
1699
- { "ABRT", SIGABRT },
1698
+ {"ABRT", SIGABRT},
1700
1699
  #endif
1701
1700
  #ifdef SIGEMT
1702
- { "EMT", SIGEMT },
1701
+ {"EMT", SIGEMT},
1703
1702
  #endif
1704
1703
  #ifdef SIGFPE
1705
- { "FPE", SIGFPE },
1704
+ {"FPE", SIGFPE},
1706
1705
  #endif
1707
1706
  #ifdef SIGKILL
1708
- { "KILL", SIGKILL },
1707
+ {"KILL", SIGKILL},
1709
1708
  #endif
1710
1709
  #ifdef SIGBUS
1711
- { "BUS", SIGBUS },
1710
+ {"BUS", SIGBUS},
1712
1711
  #endif
1713
1712
  #ifdef SIGSEGV
1714
- { "SEGV", SIGSEGV },
1713
+ {"SEGV", SIGSEGV},
1715
1714
  #endif
1716
1715
  #ifdef SIGSYS
1717
- { "SYS", SIGSYS },
1716
+ {"SYS", SIGSYS},
1718
1717
  #endif
1719
1718
  #ifdef SIGPIPE
1720
- { "PIPE", SIGPIPE },
1719
+ {"PIPE", SIGPIPE},
1721
1720
  #endif
1722
1721
  #ifdef SIGALRM
1723
- { "ALRM", SIGALRM },
1722
+ {"ALRM", SIGALRM},
1724
1723
  #endif
1725
1724
  #ifdef SIGTERM
1726
- { "TERM", SIGTERM },
1725
+ {"TERM", SIGTERM},
1727
1726
  #endif
1728
1727
  #ifdef SIGURG
1729
- { "URG", SIGURG },
1728
+ {"URG", SIGURG},
1730
1729
  #endif
1731
1730
  #ifdef SIGSTOP
1732
- { "STOP", SIGSTOP },
1731
+ {"STOP", SIGSTOP},
1733
1732
  #endif
1734
1733
  #ifdef SIGTSTP
1735
- { "TSTP", SIGTSTP },
1734
+ {"TSTP", SIGTSTP},
1736
1735
  #endif
1737
1736
  #ifdef SIGCONT
1738
- { "CONT", SIGCONT },
1737
+ {"CONT", SIGCONT},
1739
1738
  #endif
1740
1739
  #ifdef SIGCHLD
1741
- { "CHLD", SIGCHLD },
1740
+ {"CHLD", SIGCHLD},
1742
1741
  #endif
1743
1742
  #ifdef SIGCLD
1744
- { "CLD", SIGCLD },
1743
+ {"CLD", SIGCLD},
1745
1744
  #else
1746
1745
  # ifdef SIGCHLD
1747
- { "CLD", SIGCHLD, },
1746
+ {"CLD", SIGCHLD},
1748
1747
  # endif
1749
1748
  #endif
1750
1749
  #ifdef SIGTTIN
1751
- { "TTIN", SIGTTIN },
1750
+ {"TTIN", SIGTTIN},
1752
1751
  #endif
1753
1752
  #ifdef SIGTTOU
1754
- { "TTOU", SIGTTOU },
1753
+ {"TTOU", SIGTTOU},
1755
1754
  #endif
1756
1755
  #ifdef SIGIO
1757
- { "IO", SIGIO },
1756
+ {"IO", SIGIO},
1758
1757
  #endif
1759
1758
  #ifdef SIGXCPU
1760
- { "XCPU", SIGXCPU },
1759
+ {"XCPU", SIGXCPU},
1761
1760
  #endif
1762
1761
  #ifdef SIGXFSZ
1763
- { "XFSZ", SIGXFSZ },
1762
+ {"XFSZ", SIGXFSZ},
1764
1763
  #endif
1765
1764
  #ifdef SIGVTALRM
1766
- { "VTALRM", SIGVTALRM },
1765
+ {"VTALRM", SIGVTALRM},
1767
1766
  #endif
1768
1767
  #ifdef SIGPROF
1769
- { "PROF", SIGPROF },
1768
+ {"PROF", SIGPROF},
1770
1769
  #endif
1771
1770
  #ifdef SIGWINCH
1772
- { "WINCH", SIGWINCH },
1771
+ {"WINCH", SIGWINCH},
1773
1772
  #endif
1774
1773
  #ifdef SIGUSR1
1775
- { "USR1", SIGUSR1 },
1774
+ {"USR1", SIGUSR1},
1776
1775
  #endif
1777
1776
  #ifdef SIGUSR2
1778
- { "USR2", SIGUSR2 },
1777
+ {"USR2", SIGUSR2},
1779
1778
  #endif
1780
1779
  #ifdef SIGLOST
1781
- { "LOST", SIGLOST },
1780
+ {"LOST", SIGLOST},
1782
1781
  #endif
1783
1782
  #ifdef SIGMSG
1784
- { "MSG", SIGMSG },
1783
+ {"MSG", SIGMSG},
1785
1784
  #endif
1786
1785
  #ifdef SIGPWR
1787
- { "PWR", SIGPWR },
1786
+ {"PWR", SIGPWR},
1788
1787
  #endif
1789
1788
  #ifdef SIGPOLL
1790
- { "POLL", SIGPOLL },
1789
+ {"POLL", SIGPOLL},
1791
1790
  #endif
1792
1791
  #ifdef SIGDANGER
1793
- { "DANGER", SIGDANGER },
1792
+ {"DANGER", SIGDANGER},
1794
1793
  #endif
1795
1794
  #ifdef SIGMIGRATE
1796
- { "MIGRATE", SIGMIGRATE },
1795
+ {"MIGRATE", SIGMIGRATE},
1797
1796
  #endif
1798
1797
  #ifdef SIGPRE
1799
- { "PRE", SIGPRE },
1798
+ {"PRE", SIGPRE},
1800
1799
  #endif
1801
1800
  #ifdef SIGGRANT
1802
- { "GRANT", SIGGRANT },
1801
+ {"GRANT", SIGGRANT},
1803
1802
  #endif
1804
1803
  #ifdef SIGRETRACT
1805
- { "RETRACT", SIGRETRACT },
1804
+ {"RETRACT", SIGRETRACT},
1806
1805
  #endif
1807
1806
  #ifdef SIGSOUND
1808
- { "SOUND", SIGSOUND },
1807
+ {"SOUND", SIGSOUND},
1809
1808
  #endif
1810
1809
  #ifdef SIGINFO
1811
- { "INFO", SIGINFO },
1810
+ {"INFO", SIGINFO},
1812
1811
  #endif
1813
- { NULL, 0 },
1812
+ {NULL, 0}
1814
1813
  };
1815
1814
 
1816
1815
  FXint FXRbSignalNameToNumber(const char* s){
@@ -627,25 +627,21 @@ VALUE FXText_findText(FXText *self,FXString const &string,FXint start,FXuint fla
627
627
  FXint* beg;
628
628
  FXint* end;
629
629
  VALUE ary=Qnil;
630
-
631
- if(!FXMALLOC(&beg,FXint,npar)){
630
+ FXint ngroups=string.contains('(')+1; // FIXME: is this right?
631
+ if(!FXMALLOC(&beg,FXint,ngroups)){
632
632
  return Qnil;
633
- }
634
-
635
- if(!FXMALLOC(&end,FXint,npar)){
633
+ }
634
+ if(!FXMALLOC(&end,FXint,ngroups)){
636
635
  FXFREE(&beg);
637
- return Qnil;
638
- }
639
-
640
- if(self->findText(string,beg,end,start,flags,npar)){
636
+ return Qnil;
637
+ }
638
+ if(self->findText(string,beg,end,start,flags,ngroups)){
641
639
  ary=rb_ary_new();
642
- rb_ary_push(ary,FXRbMakeArray(beg,npar));
643
- rb_ary_push(ary,FXRbMakeArray(end,npar));
640
+ rb_ary_push(ary,FXRbMakeArray(beg,ngroups));
641
+ rb_ary_push(ary,FXRbMakeArray(end,ngroups));
644
642
  }
645
-
646
643
  FXFREE(&beg);
647
644
  FXFREE(&end);
648
-
649
645
  return ary;
650
646
  }
651
647
  void FXText_setHiliteStyles(FXText *self,VALUE styles){
data/lib/fox16/aliases.rb CHANGED
@@ -2849,6 +2849,9 @@ module Fox
2849
2849
  def activeChild(*args) # :nodoc:
2850
2850
  getActiveChild(*args)
2851
2851
  end
2852
+ def activeChild=(*args) # :nodoc:
2853
+ setActiveChild(*args)
2854
+ end
2852
2855
  def cascadeX=(*args) # :nodoc:
2853
2856
  setCascadeX(*args)
2854
2857
  end
data/lib/fox16/chore.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  module Fox
2
+
2
3
  class FXApp
3
4
 
4
5
  alias addChoreOrig addChore # :nodoc:
@@ -26,29 +27,41 @@ module Fox
26
27
  #
27
28
  # The last form takes a block:
28
29
  #
29
- # app.addChore() { |sender, sel, data|
30
+ # app.addChore() do |sender, sel, data|
30
31
  # ... handle the chore ...
31
- # }
32
+ # end
32
33
  #
33
34
  # All of these return a reference to an opaque FXChore instance that
34
35
  # can be passed to #removeChore if it is necessary to remove the chore
35
36
  # before it fires.
36
37
  #
38
+ # For the last two forms, you can pass in the optional +:repeat+ parameter to
39
+ # cause the chore to be re-registered after it fires, e.g.
40
+ #
41
+ # chore = app.addChore(:repeat => true) do |sender, sel, data|
42
+ # ... handle the chore ...
43
+ # ... re-add the chore ...
44
+ # end
45
+ #
37
46
  def addChore(*args, &block)
47
+ params = {}
48
+ params = args.pop if args.last.is_a? Hash
38
49
  tgt, sel = nil, 0
39
50
  if args.length > 0
40
51
  if args[0].respond_to? :call
41
- tgt = FXPseudoTarget.new
42
- tgt.pconnect(SEL_CHORE, args[0], block)
52
+ tgt = params[:target] || FXPseudoTarget.new
53
+ tgt.pconnect(SEL_CHORE, args[0], params)
43
54
  else
44
- tgt, sel = args[0], args[1]
55
+ tgt, sel = args[0], args[1]
45
56
  end
46
57
  else
47
- tgt = FXPseudoTarget.new
48
- tgt.pconnect(SEL_CHORE, nil, block)
58
+ tgt = params[:target] || FXPseudoTarget.new
59
+ tgt.pconnect(SEL_CHORE, block, params)
49
60
  end
50
61
  addChoreOrig(tgt, sel)
51
- return { :target => tgt, :selector => sel }
62
+ params[:target] = tgt
63
+ params[:selector] = sel
64
+ params
52
65
  end
53
66
 
54
67
  #
@@ -60,8 +73,8 @@ module Fox
60
73
  if args.length == 2
61
74
  removeChoreOrig(args[0], args[1])
62
75
  else
63
- hsh = args[0]
64
- removeChoreOrig(hsh[:target], hsh[:selector])
76
+ params = args[0]
77
+ removeChoreOrig(params[:target], params[:selector])
65
78
  end
66
79
  end
67
80
 
@@ -87,5 +100,6 @@ module Fox
87
100
  end
88
101
  end
89
102
 
90
- end
91
- end
103
+ end # class FXApp
104
+
105
+ end # module Fox