From: <wda...@us...> - 2008-01-17 16:08:19
|
Revision: 2260 http://oorexx.svn.sourceforge.net/oorexx/?rev=2260&view=rev Author: wdashley Date: 2008-01-17 08:08:19 -0800 (Thu, 17 Jan 2008) Log Message: ----------- ArtifactID: None Comment: Added alternative tests. Modified Paths: -------------- sandbox/david/rexxgtk.c sandbox/david/rexxgtk.cls sandbox/david/test2-1.rex sandbox/david/test2-2.rex sandbox/david/test2-3.rex sandbox/david/test4-9.rex Added Paths: ----------- sandbox/david/test2-1a.rex sandbox/david/test2-2a.rex sandbox/david/test2-3a.rex sandbox/david/test3-1a.rex sandbox/david/test3-2a.rex sandbox/david/test3-3a.rex sandbox/david/test3-4a.rex sandbox/david/test3-5a.rex sandbox/david/test3-6a.rex sandbox/david/test3-7a.rex sandbox/david/test3-8a.rex sandbox/david/test4-1a.rex sandbox/david/test4-2a.rex sandbox/david/test4-3a.rex sandbox/david/test4-4a.rex sandbox/david/test4-5a.rex sandbox/david/test4-6a.rex sandbox/david/test4-7a.rex sandbox/david/test4-9a.rex Modified: sandbox/david/rexxgtk.c =================================================================== --- sandbox/david/rexxgtk.c 2008-01-17 13:26:46 UTC (rev 2259) +++ sandbox/david/rexxgtk.c 2008-01-17 16:08:19 UTC (rev 2260) @@ -192,6 +192,7 @@ "GrxToggleButtonSetInconsistent", "GrxToggleButtonConnectSignal", "GrxCheckButtonNew", + "GrxRadioButtonNew", "GrxRadioButtonNewFromWidget", "GrxRadioButtonGetGroup", "GrxRadioButtonSetGroup", Modified: sandbox/david/rexxgtk.cls =================================================================== --- sandbox/david/rexxgtk.cls 2008-01-17 13:26:46 UTC (rev 2259) +++ sandbox/david/rexxgtk.cls 2008-01-17 16:08:19 UTC (rev 2260) @@ -1042,16 +1042,24 @@ xopt, yopt, xpad, ypad return -::method set_row_spacings +::method 'row_spacings=' use strict arg spacing call GrxTableSetRowSpacings self~pointer, spacing return -::method set_col_spacings +::method set_row_spacings +use strict arg self~row_spacings +return + +::method 'col_spacings=' use strict arg spacing call GrxTableSetColSpacings self~pointer, spacing return +::method set_col_spacings +use strict arg self~col_spacings +return + ::method connect_signal use strict arg event self~connect_signal:super(event) Modified: sandbox/david/test2-1.rex =================================================================== --- sandbox/david/test2-1.rex 2008-01-17 13:26:46 UTC (rev 2259) +++ sandbox/david/test2-1.rex 2008-01-17 16:08:19 UTC (rev 2260) @@ -45,8 +45,6 @@ -- by Andrew Krause window = .GTKWindow~new('GTK_WINDOW_TOPLEVEL') --- the following could also be coded as --- window~title = 'Hello World' window~set_title('Hello World') window~show() Added: sandbox/david/test2-1a.rex =================================================================== --- sandbox/david/test2-1a.rex (rev 0) +++ sandbox/david/test2-1a.rex 2008-01-17 16:08:19 UTC (rev 2260) @@ -0,0 +1,64 @@ +#!/usr/bin/rexx +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2007-2008 Rexx Language Association. All rights reserved. */ +/* */ +/* This program and the accompanying materials are made available under */ +/* the terms of the Common Public License v1.0 which accompanies this */ +/* distribution. A copy is also available at the following address: */ +/* http://www.oorexx.org/license.html */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the name of Rexx Language Association nor the names */ +/* of its contributors may be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ +/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ +/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ +/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/* Authors; */ +/* W. David Ashley <da...@us...> */ +/* */ +/*----------------------------------------------------------------------------*/ + + +-- Derived from Listing 2-1 +-- Foundations of GTK+ Development +-- by Andrew Krause + +-- This is an alternative example that uses a more ooRexx friendly syntax. The +-- original example uses methods that are direct ports of the GTK C function +-- calls. This example uses a syntax that is more Rexx-like. + +window = .GTKWindow~new('GTK_WINDOW_TOPLEVEL') +window~title = 'Hello World' +window~show() + +say 'You must ctrl-c (twice) to end this program after closing the window' + +call gtk_main + +-- we will never get here since there is no connection to a destroy routine +return + + +::requires 'rexxgtk.cls' + Property changes on: sandbox/david/test2-1a.rex ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Modified: sandbox/david/test2-2.rex =================================================================== --- sandbox/david/test2-2.rex 2008-01-17 13:26:46 UTC (rev 2259) +++ sandbox/david/test2-2.rex 2008-01-17 16:08:19 UTC (rev 2260) @@ -45,8 +45,6 @@ -- by Andrew Krause window = .myMainWindow~new('GTK_WINDOW_TOPLEVEL') --- the following could also be coded as --- window~title = 'Hello World' window~set_title( 'Hello World') window~set_border_width(10) window~set_size_request(200, 100) Added: sandbox/david/test2-2a.rex =================================================================== --- sandbox/david/test2-2a.rex (rev 0) +++ sandbox/david/test2-2a.rex 2008-01-17 16:08:19 UTC (rev 2260) @@ -0,0 +1,77 @@ +#!/usr/bin/rexx +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2007-2008 Rexx Language Association. All rights reserved. */ +/* */ +/* This program and the accompanying materials are made available under */ +/* the terms of the Common Public License v1.0 which accompanies this */ +/* distribution. A copy is also available at the following address: */ +/* http://www.oorexx.org/license.html */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the name of Rexx Language Association nor the names */ +/* of its contributors may be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ +/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ +/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ +/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/* Authors; */ +/* W. David Ashley <da...@us...> */ +/* */ +/*----------------------------------------------------------------------------*/ + + +-- Derived from Listing 2-2 +-- Foundations of GTK+ Development +-- by Andrew Krause + +-- This is an alternative example that uses a more ooRexx friendly syntax. The +-- original example uses methods that are direct ports of the GTK C function +-- calls. This example uses a syntax that is more Rexx-like. + +window = .myMainWindow~new('GTK_WINDOW_TOPLEVEL') +window~title = 'Hello World' +window~border_width = 10 +window~set_size_request(200, 100) + +window~connect_signal("destroy") +-- events cannot be overridden so there is no connect to a delete_event + +label= .GtkLabel~new('Hellow World') +label~selectable = .true + +window~add(label) +window~show_all() + +call gtk_main + +return + + +::requires 'rexxgtk.cls' + +::class myMainWindow subclass GtkWindow + +::method signal_destroy +.local['GTK_Quit'] = .true +return + Property changes on: sandbox/david/test2-2a.rex ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Modified: sandbox/david/test2-3.rex =================================================================== --- sandbox/david/test2-3.rex 2008-01-17 13:26:46 UTC (rev 2259) +++ sandbox/david/test2-3.rex 2008-01-17 16:08:19 UTC (rev 2260) @@ -45,9 +45,7 @@ -- by Andrew Krause window = .myMainWindow~new('GTK_WINDOW_TOPLEVEL') --- the following could also be coded as --- window~title = 'Hello World' -window~set_title('Buttons') +window~title = 'Hello World' window~set_border_width(25) window~set_size_request(200, 100) Added: sandbox/david/test2-3a.rex =================================================================== --- sandbox/david/test2-3a.rex (rev 0) +++ sandbox/david/test2-3a.rex 2008-01-17 16:08:19 UTC (rev 2260) @@ -0,0 +1,90 @@ +#!/usr/bin/rexx +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2007-2008 Rexx Language Association. All rights reserved. */ +/* */ +/* This program and the accompanying materials are made available under */ +/* the terms of the Common Public License v1.0 which accompanies this */ +/* distribution. A copy is also available at the following address: */ +/* http://www.oorexx.org/license.html */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the name of Rexx Language Association nor the names */ +/* of its contributors may be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ +/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ +/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ +/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/* Authors; */ +/* W. David Ashley <da...@us...> */ +/* */ +/*----------------------------------------------------------------------------*/ + + +-- Derived from Listing 2-3 +-- Foundations of GTK+ Development +-- by Andrew Krause + +-- This is an alternative example that uses a more ooRexx friendly syntax. The +-- original example uses methods that are direct ports of the GTK C function +-- calls. This example uses a syntax that is more Rexx-like. + +window = .myMainWindow~new('GTK_WINDOW_TOPLEVEL') +window~title = 'Hello World' +window~border_width = 25 +window~set_size_request(200, 100) + +window~connect_signal("destroy") + +button = .MyButton~new('_Close') + +button~connect_signal("clicked") + +window~add(button) + +window~show_all() + +call gtk_main + +return + + +::requires 'rexxgtk.cls' + +::class myMainWindow subclass GtkWindow + +::method signal_destroy +.local['GTK_Quit'] = .true +return + +::class MyButton subclass GtkButton_With_Mnemonic + +::method signal_clicked +-- get the pointer to the top level parent window of the button +-- Note that the pointer string may be returned in lower case, that's bad! +widgetpointer = upper(GrxWidgetGetTopLevel(self~pointer)) +-- resolve the ooRexx widget from the pointer +widget = .local['GTK_Database']~at(widgetpointer) +-- tell the widget to destroy itself +widget~destroy() +return + Property changes on: sandbox/david/test2-3a.rex ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: sandbox/david/test3-1a.rex =================================================================== --- sandbox/david/test3-1a.rex (rev 0) +++ sandbox/david/test3-1a.rex 2008-01-17 16:08:19 UTC (rev 2260) @@ -0,0 +1,94 @@ +#!/usr/bin/rexx +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2007-2008 Rexx Language Association. All rights reserved. */ +/* */ +/* This program and the accompanying materials are made available under */ +/* the terms of the Common Public License v1.0 which accompanies this */ +/* distribution. A copy is also available at the following address: */ +/* http://www.oorexx.org/license.html */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the name of Rexx Language Association nor the names */ +/* of its contributors may be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ +/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ +/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ +/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/* Authors; */ +/* W. David Ashley <da...@us...> */ +/* */ +/*----------------------------------------------------------------------------*/ + + +-- Derived from Listing 3-1 +-- Foundations of GTK+ Development +-- by Andrew Krause + +names = .array~of('Andrew', 'Joe', 'Samatha', 'Jonanthan') + +-- This is an alternative example that uses a more ooRexx friendly syntax. The +-- original example uses methods that are direct ports of the GTK C function +-- calls. This example uses a syntax that is more Rexx-like. + +window = .myMainWindow~new('GTK_WINDOW_TOPLEVEL') +window~title = 'Boxes' +window~border_width = 10 +window~set_size_request(200, -1) +window~connect_signal("destroy") + +vbox = .GtkVBox~new() + +do i = 1 to names~items() + button = .myButton~new(names[i]) + vbox~pack_start_defaults(button) + button~connect_signal("clicked") + end + +window~add(vbox) +window~show_all() + +call gtk_main + +return + + +::requires 'rexxgtk.cls' + +::class myMainWindow subclass GtkWindow + +::method signal_destroy +.local['GTK_Quit'] = .true +return + +::class myButton subclass GtkButton_With_Mnemonic + +::method signal_clicked +-- get the pointer to the top level parent window of the button +-- Note that the pointer string may be returned in lower case, that's bad! +widgetpointer = upper(GrxWidgetGetTopLevel(self~pointer)) +-- resolve the ooRexx widget from the pointer +widget = .local['GTK_Database']~at(widgetpointer) +-- tell the widget to destroy itself +widget~destroy() +return + Property changes on: sandbox/david/test3-1a.rex ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: sandbox/david/test3-2a.rex =================================================================== --- sandbox/david/test3-2a.rex (rev 0) +++ sandbox/david/test3-2a.rex 2008-01-17 16:08:19 UTC (rev 2260) @@ -0,0 +1,97 @@ +#!/usr/bin/rexx +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2007-2008 Rexx Language Association. All rights reserved. */ +/* */ +/* This program and the accompanying materials are made available under */ +/* the terms of the Common Public License v1.0 which accompanies this */ +/* distribution. A copy is also available at the following address: */ +/* http://www.oorexx.org/license.html */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the name of Rexx Language Association nor the names */ +/* of its contributors may be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ +/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ +/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ +/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/* Authors; */ +/* W. David Ashley <da...@us...> */ +/* */ +/*----------------------------------------------------------------------------*/ + + +-- Derived from Listing 3-2 +-- Foundations of GTK+ Development +-- by Andrew Krause + +-- This is an alternative example that uses a more ooRexx friendly syntax. The +-- original example uses methods that are direct ports of the GTK C function +-- calls. This example uses a syntax that is more Rexx-like. + +names = .array~of('Andrew', 'Joe', 'Samatha', 'Jonanthan') + +-- create a new top level window with a title +window = .myMainWindow~new('GTK_WINDOW_TOPLEVEL') +window~title = 'Boxes' +window~connect_signal("destroy") + +window~border_width = 10 +window~set_size_request(200, -1) + +vbox = .GtkVBox~new() + +do i = 1 to names~items() + button = .MyButton~new(names[i]) + vbox~pack_end(button, .false, .false, 5) + button~connect_signal("clicked") + end + +window~add(vbox) +window~show_all() + +-- start the GTL main event loop +call gtk_main + +return + + +::requires 'rexxgtk.cls' + +::class myMainWindow subclass GtkWindow + +::method signal_destroy +.local['GTK_Quit'] = .true +return + +::class myButton subclass GtkButton_With_Mnemonic + +::method signal_clicked +-- get the pointer to the top level parent window of the button +-- Note that the pointer string may be returned in lower case, that's bad! +widgetpointer = upper(GrxWidgetGetTopLevel(self~pointer)) +-- resolve the ooRexx widget from the pointer +widget = .local['GTK_Database']~at(widgetpointer) +-- tell the widget to destroy itself +widget~destroy() +return + Property changes on: sandbox/david/test3-2a.rex ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: sandbox/david/test3-3a.rex =================================================================== --- sandbox/david/test3-3a.rex (rev 0) +++ sandbox/david/test3-3a.rex 2008-01-17 16:08:19 UTC (rev 2260) @@ -0,0 +1,98 @@ +#!/usr/bin/rexx +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2007-2008 Rexx Language Association. All rights reserved. */ +/* */ +/* This program and the accompanying materials are made available under */ +/* the terms of the Common Public License v1.0 which accompanies this */ +/* distribution. A copy is also available at the following address: */ +/* http://www.oorexx.org/license.html */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the name of Rexx Language Association nor the names */ +/* of its contributors may be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ +/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ +/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ +/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/* Authors; */ +/* W. David Ashley <da...@us...> */ +/* */ +/*----------------------------------------------------------------------------*/ + + +-- Derived from Listing 3-3 +-- Foundations of GTK+ Development +-- by Andrew Krause + +-- This is an alternative example that uses a more ooRexx friendly syntax. The +-- original example uses methods that are direct ports of the GTK C function +-- calls. This example uses a syntax that is more Rexx-like. + +names = .array~of('Andrew', 'Joe', 'Samatha', 'Jonanthan') + +window = .myMainWindow~new('GTK_WINDOW_TOPLEVEL') +window~title = 'Panes' +window~connect_signal("destroy") + +window~border_width = 10 +window~set_size_request(225, 150) + +hpaned = .GtkHPaned~new() +button1 = .MyButton~new('Resize') +button2 = .MyButton~new('Me!') + +button1~connect_signal("clicked") +button2~connect_signal("clicked") + +hpaned~add1(button1) +hpaned~add2(button2) + +window~add(hpaned) +window~show_all() + +-- start the GTL main event loop +call gtk_main + +return + + +::requires 'rexxgtk.cls' + +::class myMainWindow subclass GtkWindow + +::method signal_destroy +.local['GTK_Quit'] = .true +return + +::class myButton subclass GtkButton_With_Mnemonic + +::method signal_clicked +-- get the pointer to the top level parent window of the button +-- Note that the pointer string may be returned in lower case, that's bad! +widgetpointer = upper(GrxWidgetGetTopLevel(self~pointer)) +-- resolve the ooRexx widget from the pointer +widget = .local['GTK_Database']~at(widgetpointer) +-- tell the widget to destroy itself +widget~destroy() +return + Property changes on: sandbox/david/test3-3a.rex ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: sandbox/david/test3-4a.rex =================================================================== --- sandbox/david/test3-4a.rex (rev 0) +++ sandbox/david/test3-4a.rex 2008-01-17 16:08:19 UTC (rev 2260) @@ -0,0 +1,84 @@ +#!/usr/bin/rexx +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2007-2008 Rexx Language Association. All rights reserved. */ +/* */ +/* This program and the accompanying materials are made available under */ +/* the terms of the Common Public License v1.0 which accompanies this */ +/* distribution. A copy is also available at the following address: */ +/* http://www.oorexx.org/license.html */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the name of Rexx Language Association nor the names */ +/* of its contributors may be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ +/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ +/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ +/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/* Authors; */ +/* W. David Ashley <da...@us...> */ +/* */ +/*----------------------------------------------------------------------------*/ + + +-- Derived from Listing 3-4 +-- Foundations of GTK+ Development +-- by Andrew Krause + +-- This is an alternative example that uses a more ooRexx friendly syntax. The +-- original example uses methods that are direct ports of the GTK C function +-- calls. This example uses a syntax that is more Rexx-like. + +window = .myMainWindow~new('GTK_WINDOW_TOPLEVEL') +window~title = 'Tables' +window~connect_signal("destroy") +window~border_width = 10 +window~set_size_request(350, 100) -- the sizes in the book are too small + +table = .GtkTable~new(2, 2, .true) +label = .GtkLabel~new('Enter the following information ...') +label2 = .GtkLabel~new('Name: ') +name = .GtkEntry~new() + +table~attach(label, 0, 2, 0, 1, 'GTK_EXPAND', 'GTK_SHRINK', 0, 0) +table~attach(label2, 0, 1, 1, 2, 'GTK_EXPAND', 'GTK_SHRINK', 0, 0) +table~attach(name, 1, 2, 1, 2, 'GTK_EXPAND', 'GTK_SHRINK', 0, 0) + +table~row_spacings = 5 +table~col_spacings = 5 + +window~add(table) +window~show_all() + +call gtk_main + +return + + +::requires 'rexxgtk.cls' + +::class myMainWindow subclass GtkWindow + +::method signal_destroy +.local['GTK_Quit'] = .true +return + Property changes on: sandbox/david/test3-4a.rex ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: sandbox/david/test3-5a.rex =================================================================== --- sandbox/david/test3-5a.rex (rev 0) +++ sandbox/david/test3-5a.rex 2008-01-17 16:08:19 UTC (rev 2260) @@ -0,0 +1,89 @@ +#!/usr/bin/rexx +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2007-2008 Rexx Language Association. All rights reserved. */ +/* */ +/* This program and the accompanying materials are made available under */ +/* the terms of the Common Public License v1.0 which accompanies this */ +/* distribution. A copy is also available at the following address: */ +/* http://www.oorexx.org/license.html */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the name of Rexx Language Association nor the names */ +/* of its contributors may be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ +/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ +/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ +/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/* Authors; */ +/* W. David Ashley <da...@us...> */ +/* */ +/*----------------------------------------------------------------------------*/ + + +-- Derived from Listing 3-5 +-- Foundations of GTK+ Development +-- by Andrew Krause + +-- This is an alternative example that uses a more ooRexx friendly syntax. The +-- original example uses methods that are direct ports of the GTK C function +-- calls. This example uses a syntax that is more Rexx-like. + +window = .myMainWindow~new('GTK_WINDOW_TOPLEVEL') +window~title = 'Fixed' +window~connect_signal("destroy") +window~set_border_width(10) + +fixed = .GtkFixed~new() +button1 = .MyButton~new('Pixed by Pixel ...') +button2 = .MyButton~new('you choose by fate.') + +button1~connect_signal("clicked") +button2~connect_signal("clicked") + +fixed~put(button1, 0, 0) +fixed~put(button2, 20, 30) + +window~add(fixed) +window~show_all() + +call gtk_main + +return + + +::requires 'rexxgtk.cls' + +::class myMainWindow subclass GtkWindow + +::method signal_destroy +.local['GTK_Quit'] = .true +return + +::class MyButton subclass GtkButton_With_Label + +::method signal_clicked +widgetpointer = upper(GrxWidgetGetTopLevel(self~pointer)) +widget = .local['GTK_Database']~at(widgetpointer) +widget~destroy() +return + Property changes on: sandbox/david/test3-5a.rex ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: sandbox/david/test3-6a.rex =================================================================== --- sandbox/david/test3-6a.rex (rev 0) +++ sandbox/david/test3-6a.rex 2008-01-17 16:08:19 UTC (rev 2260) @@ -0,0 +1,78 @@ +#!/usr/bin/rexx +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2007-2008 Rexx Language Association. All rights reserved. */ +/* */ +/* This program and the accompanying materials are made available under */ +/* the terms of the Common Public License v1.0 which accompanies this */ +/* distribution. A copy is also available at the following address: */ +/* http://www.oorexx.org/license.html */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the name of Rexx Language Association nor the names */ +/* of its contributors may be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ +/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ +/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ +/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/* Authors; */ +/* W. David Ashley <da...@us...> */ +/* */ +/*----------------------------------------------------------------------------*/ + + +-- Derived from Listing 3-6 +-- Foundations of GTK+ Development +-- by Andrew Krause + +-- This is an alternative example that uses a more ooRexx friendly syntax. The +-- original example uses methods that are direct ports of the GTK C function +-- calls. This example uses a syntax that is more Rexx-like. + +window = .myMainWindow~new('GTK_WINDOW_TOPLEVEL') +window~title = 'Expander' +window~connect_signal("destroy") +window~border_width = 10 +window~set_size_request(200, 100) + +expander = .GtkExpander_With_Mnemonic~new('Click _Me For More!') +label = .GtkLabel~new('Hide me or show me,' || '0A'x || 'that is your choice') + +expander~add(label) +expander~expanded = .true +window~add(expander) + +window~show_all() + +call gtk_main + +return + + +::requires 'rexxgtk.cls' + +::class myMainWindow subclass GtkWindow + +::method signal_destroy +.local['GTK_Quit'] = .true +return + Property changes on: sandbox/david/test3-6a.rex ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: sandbox/david/test3-7a.rex =================================================================== --- sandbox/david/test3-7a.rex (rev 0) +++ sandbox/david/test3-7a.rex 2008-01-17 16:08:19 UTC (rev 2260) @@ -0,0 +1,79 @@ +#!/usr/bin/rexx +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2007-2008 Rexx Language Association. All rights reserved. */ +/* */ +/* This program and the accompanying materials are made available under */ +/* the terms of the Common Public License v1.0 which accompanies this */ +/* distribution. A copy is also available at the following address: */ +/* http://www.oorexx.org/license.html */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the name of Rexx Language Association nor the names */ +/* of its contributors may be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ +/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ +/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ +/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/* Authors; */ +/* W. David Ashley <da...@us...> */ +/* */ +/*----------------------------------------------------------------------------*/ + + +-- Derived from Listing 3-7 +-- Foundations of GTK+ Development +-- by Andrew Krause + +-- This is an alternative example that uses a more ooRexx friendly syntax. The +-- original example uses methods that are direct ports of the GTK C function +-- calls. This example uses a syntax that is more Rexx-like. + +window = .myMainWindow~new('GTK_WINDOW_TOPLEVEL') +window~title = 'Handle Box' +window~connect_signal("destroy") +window~border_width = 10 +window~set_size_request(200, 100) + +handle = .GtkHandleBox~new() +label = .GtkLabel~new('Detach Me') + +handle~shadow_type = 'GTK_SHADOW_IN' +handle~handle_position = 'GTK_POS_LEFT' +handle~snap_edge = 'GTK_POS_TOP' + +handle~add(label) +window~add(handle) +window~show_all() + +call gtk_main +return + + +::requires 'rexxgtk.cls' + +::class myMainWindow subclass GtkWindow + +::method signal_destroy +.local['GTK_Quit'] = .true +return + Property changes on: sandbox/david/test3-7a.rex ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: sandbox/david/test3-8a.rex =================================================================== --- sandbox/david/test3-8a.rex (rev 0) +++ sandbox/david/test3-8a.rex 2008-01-17 16:08:19 UTC (rev 2260) @@ -0,0 +1,102 @@ +#!/usr/bin/rexx +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2007-2008 Rexx Language Association. All rights reserved. */ +/* */ +/* This program and the accompanying materials are made available under */ +/* the terms of the Common Public License v1.0 which accompanies this */ +/* distribution. A copy is also available at the following address: */ +/* http://www.oorexx.org/license.html */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the name of Rexx Language Association nor the names */ +/* of its contributors may be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ +/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ +/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ +/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/* Authors; */ +/* W. David Ashley <da...@us...> */ +/* */ +/*----------------------------------------------------------------------------*/ + + +-- Derived from Listing 3-8 +-- Foundations of GTK+ Development +-- by Andrew Krause + +-- Note: The source code in the book is wrong. The downloaded source for the +-- book is correct. Label controls do not respond to the "clicked" signal so +-- we need buttons instead. + +-- This is an alternative example that uses a more ooRexx friendly syntax. The +-- original example uses methods that are direct ports of the GTK C function +-- calls. This example uses a syntax that is more Rexx-like. + +window = .myMainWindow~new('GTK_WINDOW_TOPLEVEL') +window~title = 'Notebook' +window~connect_signal("destroy") +window~border_width = 10 +window~set_size_request(200, 100) + +notebook = .GtkNotebook~new() +label1 = .GtkLabel~new('Page One') +label2 = .GtkLabel~new('Page Two') +child1 = .MyButton~new('Go to page 2 to find the answer.') +child2 = .MyButton~new('Go to page 1 to find the answer.') + +child1~connect_signal('clicked') +child2~connect_signal('clicked') +-- Store the notebook widget so we can get access to it in the callbacks +child1~user_data = notebook +child2~user_data = notebook + +notebook~append_page(child1, label1) +notebook~append_page(child2, label2) + +notebook~tab_pos = 'GTK_POS_BOTTOM' + +window~add(notebook) +window~show_all() + +call gtk_main +return + + +::requires 'rexxgtk.cls' + +::class myMainWindow subclass GtkWindow + +::method signal_destroy +.local['GTK_Quit'] = .true +return + +::class MyButton subclass GtkButton_With_Label + +::method signal_clicked +notebook = self~user_data -- get the notebook widget +page = notebook~current_page +if page = 0 then notebook~current_page = 1 +else if page = 1 then notebook~current_page = 0 +else nop +return + Property changes on: sandbox/david/test3-8a.rex ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: sandbox/david/test4-1a.rex =================================================================== --- sandbox/david/test4-1a.rex (rev 0) +++ sandbox/david/test4-1a.rex 2008-01-17 16:08:19 UTC (rev 2260) @@ -0,0 +1,83 @@ +#!/usr/bin/rexx +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2007-2008 Rexx Language Association. All rights reserved. */ +/* */ +/* This program and the accompanying materials are made available under */ +/* the terms of the Common Public License v1.0 which accompanies this */ +/* distribution. A copy is also available at the following address: */ +/* http://www.oorexx.org/license.html */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the name of Rexx Language Association nor the names */ +/* of its contributors may be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ +/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ +/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ +/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/* Authors; */ +/* W. David Ashley <da...@us...> */ +/* */ +/*----------------------------------------------------------------------------*/ + + +-- Derived from Listing 4-1 +-- Foundations of GTK+ Development +-- by Andrew Krause + +-- This is an alternative example that uses a more ooRexx friendly syntax. The +-- original example uses methods that are direct ports of the GTK C function +-- calls. This example uses a syntax that is more Rexx-like. + +window = .myMainWindow~new('GTK_WINDOW_TOPLEVEL') +window~title = 'Stock Buttons' +window~connect_signal("destroy") +window~border_width = 10 +window~set_size_request(250, 100) + +button = .MyButton~new('gtk-close') + +button~connect_signal("clicked") + +window~add(button) +window~show_all() + +call gtk_main +return + + +::requires 'rexxg... [truncated message content] |