View script | License | Download documentation as: HTML or editable |
Download script | History | Other scripts by: btiffin |
[0.062] 16.687k
Documentation for: rebgui-table.rUsage document for %rebgui-table.r1. Introduction to %rebgui-table.rrebgui-table.r is an introduction to the ease of gui creation with RebGUI.
2. rebgui-table At a GlanceNo setup is required, just do it. >> do %rebgui-table.r The above image was created running REBOL/View 2.7.5.4.2, RebGUI build #93, GNU/Linux 4.0, KDE Desktop. 3. Using %rebgui-table.rRequires REBOL/View, access to a cached copy of RebGUI or internet access for getting a cached copy. 3.1. Running %rebgui-table.rFrom the library with: >> do http://www.rebol.org/cgi-bin/cgiwrap/rebol/download-a-script.r?script-name=rebgui-table.ror locally with: >> do %rebgui-table.r 4. What you can learnThis script is an introduction to the display function and table widget of RebGUI. Both REBOL/View and RebGUI are available RebGUI gui building is easy, and offers a flexible 'business polish' to application design. There are many features under the hood. 4.1. do-thruThis example uses the REBOL/View do-thru feature. do-thru will execute a script from the REBOL/View sandbox (another name for cache). It will retrieve the code from the internet, only if there is not a cached copy. If you do develop something with RebGUI, and build it using the REBOL/SDK, you may not have access to do-thru. The RebGUI home site explains all this. This is just an example, and assumes you are using a full fledged REBOL/View. 4.2. The table widgetThis short example highlights the ease and power of the table widget in RebGUI. As just an example, it does no real justice to the full power of table and RebGUI widgets. When running, you can sort the columns, move the splitter, select an entry by simply clicking...and other nifty things. 4.2.1. on-clickThe keyword on-click is not really necessary, the first action block of a RebGUI widget is the on-click action. 4.2.2. set-colorset-color is a RebGUI support function for controlling colors of many RebGUI widgets. 4.2.3. do-eventsThe standard REBOL event handler is used by RebGUI. do-events is used to start the event handling loop in REBOL. The REBOL/View view function includes a call to this event loop. RebGUI requires it to be called separately, a feature that allows for processing between and around the GUI layout, the display and handling the events. 4.3. What you can change.For early experiments with your local copy, try adding a column, perhaps the inverted color value. Change the foreach loop to build the table-data ; Build a data table, three columns; color name and color tuples table-data: copy [] foreach color ctx-rebgui/locale*/colors [ append table-data color append table-data get color append table-data subtract 255.255.255 get color ]and then update the options block for the table headers. In the action block, pick the third item to change the bbox color, instead of recalculating. The table was made a little bigger, and the percentages for the columns were also changed, just for the looks. ; Display a RebGUI table display "RebGUI table Example" [ table 75x25 options ["Color" left .25 "RGB" right .375 "-RGB" right .375] data table-data on-click [set-color abox second face/selected set-color bbox third face/selected] 5. What can breakNothing to break here. Well, REBOL/Core will not have the capabilities to run RebGUI, You will need to start up REBOL/View. 5.1. REBOL/SDKThe RebGUI designer, Ashley Trüter has taken great strides to allow the REBOL/SDK to build a RebGUI application that does not require all the REBOL/View features for a lean, mean application. Full information starts at the RebGUI Home 6. Credits
|