Introduction © Jean-Pierre ANGHEL - 2004 FXRuby Par l’exemple Table des matières. 2 Introduction. 4 Chapitre 1. 6 Bref historique de Ruby. 6 Bref historique de Fox. 6 Où trouver Ruby ?. Avec quel éditeur de texte ?. Quelles connaissances faut-il avoir ?. Avantages divers. 7 Présentation des composants visuels. 7 Présentation des aménageurs d'espace. 8 Chapitre 2. 9 Les fenêtres et tout ce qui va avec. 9 Un peu de Ruby. 10 Particularités de FXRuby. 11 Chapitre 3. 12 Le bouton simple. 12 Un peu de ruby (1) : 15 Les commentaires et substitutions. 15 Exemple général sur les boutons. 16 Particularités de FXRuby : 20 Les cadres et séparateurs. 22 Les boîtes à grouper. 22 Les cases à cocher. 23 Les boutons-radio. 23 Les boutons-bascule. 23 Les boutons avec flèches incorporées. 23 Les bulles d'aide. 24 La barre de statut 24 Un peu de Ruby (2) : 24 Les variables. 24 Les opérateurs. 25 Les méthodes. 26 Chapitre 4. 28 Les canevas. 28 Un peu de Ruby. 32 Les blocs. 32 Les itérateurs. 33 Les boucles. 33 Les expressions conditionnelles. 34 Notes. 167 p1
Ruby Programming/Print version Ruby is an object-oriented scripting language developed by Yukihiro Matsumoto ("Matz"). The main web site for Ruby is ruby-lang.org. Development began in February 1993 and the first alpha version of Ruby was released in December 1994. Mac OS X comes with Ruby already installed. Features Object Oriented Ruby goes to great lengths to be a purely object oriented language. Every class has a set of methods which can be called on objects of that class. Every object has a set of instance variables which hold the state of the object. Mixins In addition to classes, Ruby has modules. Dynamic Ruby is a very dynamic programming language. Variables in Ruby are dynamically typed, which means that any variable can hold any type of object. Singleton Classes When I said that every Ruby object has a class, I lied. Ruby is so object oriented that even classes, modules and methods are themselves objects! Flexibility Variables and scope You do not need to declare variables or variable scope in Ruby. Blocks Linux .
Ruby Programming/GUI Toolkit Modules Ruby GUI toolkits are typically 3rd party GUI platforms that are driven (wrapped) by a Ruby driver. Ruby bindings are available for several widget toolkits, among them Tk, Gtk, Fox, and Qt. Here is a spreadsheet comparison. See also "this list": and "this one": FXRuby[edit] FXRuby is a Ruby binding for the Fox GUI toolkit written in C++. Advantages[edit] Has a book, Disadvantages[edit] The book is over three years old.Non-native look and feel. FoxGUIb[edit] FoxGUIb is a visual GUI builder that can be used to create Fox UI's graphically instead of programmatically. Advantages[edit] Allows user to build a GUI screen quickly.Subclasses event handling allowing decoupling between GUI elements and Ruby event code. Disadvantages[edit] qtRuby[edit] Advantages:[edit] Disadvantages:[edit] Tk[edit]
squeak_screencasts – Squeak Community Projects The image as a persistent world ¶ Description The image is your working environment. All your modifications are stored with its state. This video shows how you open your image how you can go back to the state before opening. Preview Video [ Download Basic Elements of the Image ¶ In this video we take a tour around the basic UI elements and menus of the image. How to Recover Changes ¶ Help! Halos to access morphs ¶ Halos provide an instant access to graphical elements of the image. How to update your Image ¶ How to modify settings and change your browser ¶ The image has a menu for editing all your preferences. Demo mode – large text for using a beamer or making screenshots ¶ In "Demo Mode" all text is large enough to be legible while using a beamer, making a screencast or taking screenshots. Organise your work with projects ¶ Projects are a nice way to organise different workplaces in one image. File out file in – the image and its environment ¶ Brief summary ¶ Basic usage of the class browser ¶ Help!
Ruby/TK Guide Introduction The standard graphical user interface (GUI) for Ruby is Tk. Tk started out as the GUI for the Tcl scripting language developed by John Ousterhout. Tk has the unique distinction of being the only cross-platform GUI. Tk runs on Windows, Mac, and Linux and provides a native look-and-feel on each operating system. The basic component of a Tk-based application is called a widget. Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.There are three geometry managers; place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. Installation The Ruby Tk bindings are distributed with Ruby but Tk is a separate installation. Simple Tk Application Get Started
RaspberryPiBoard Notice: The Raspberry Pi Wiki pages on this site is collaborative work - the Raspberry Pi Foundation is not responsible for content on these pages. Now shipping to customers See the Buying Guide on how to order one, or visit the Raspberry Pi Foundation Home Page About The Raspberry Pi production board (model B Rev 2.0) 3D CAD Model of the Raspberry Pi 3 Model B (Download) The Raspberry Pi (short: RPi or RasPi) is an ultra-low-cost ($20-$35) credit-card sized Linux computer which was conceived with the primary goal of teaching computer programming to children. Raspberry Pi is manufactured and sold in partnership with the worldwide industrial distributors Premier Farnell/Element 14 and RS Components, and the Chinese distributor Egoman Technology Corp[1]. You can get the latest news from the Foundation Home Page, the Twitter Feed or in the forums. Products are RoHS, CE, FCC, CTick, CSA and WEEE compliant[2]. History Getting Started Resources Books Education Material Community About the RPi Wiki
GUI Frameworks Glimmer DSL for SWT (JRuby Desktop Development Cross-Platform Native GUI Framework) is a native-GUI cross-platform desktop development library written in JRuby, an OS-threaded faster JVM version of Ruby. It includes SWT 4.29 (released on September 3, 2023). Glimmer's main innovation is a declarative Ruby DSL that enables productive and efficient authoring of professional-grade desktop applications by relying on the robust Eclipse SWT library, with the familiar native look, feel, and behavior of GUI on Mac, Windows, and Linux. CodeKata File (Ruby 2.2.0) absolute_path(file_name [, dir_string] ) → abs_file_name click to toggle source Converts a pathname to an absolute pathname. Relative paths are referenced from the current working directory of the process unless dir_string is given, in which case it will be used as the starting point. File.absolute_path("~oracle/bin") VALUE rb_file_s_absolute_path(int argc, const VALUE *argv) { VALUE fname, dname; if (argc == 1) { return rb_file_absolute_path(argv[0], Qnil); } rb_scan_args(argc, argv, "11", &fname, &dname); return rb_file_absolute_path(fname, dname); } atime(file_name) → time click to toggle source Returns the last access time for the named file as a Time object). file_name can be an IO object. File.atime("testfile") static VALUE rb_file_s_atime(VALUE klass, VALUE fname) { struct stat st; if (rb_stat(fname, &st) < 0) { FilePathValue(fname); rb_sys_fail_path(fname); } return stat_atime(&st); } basename(file_name [, suffix] ) → base_name click to toggle source File.birthtime("testfile") blockdev?
Kidsruby.com Modéliser ses fenêtres avec Qt Designer Placer des widgets sur la fenêtre est en fait très simple : vous prenez le widget que vous voulez dans la liste à gauche, et vous le faites glisser où vous voulez sur la fenêtre. Ce qui est très important à savoir, c'est qu'on peut placer ses widgets de 2 manières différentes : : vos widgets seront disposés au pixel près sur la fenêtre. (recommandé pour les fenêtres complexes) : vous pouvez utiliser tous les layouts que vous connaissez. Commençons par les placer de manière absolue, puis nous verrons comment utiliser les layouts dans Qt Designer. Placer les widgets de manière absolue Je vous propose pour vous entraîner de faire une petite fenêtre simple composée de 3 widgets : QSlider QLabel QProgressBar Votre fenêtre devrait à peu près ressembler à ceci maintenant : Vous pouvez déplacer ces widgets comme bon vous semble sur la fenêtre. Vous pouvez les agrandir ou les rétrécir. Quelques raccourcis à connaître : Faites pour supprimer les widgets sélectionnés. Utiliser les layouts Insérer des spacers
PragDave IO binread(name, [length [, offset]] ) → string click to toggle source Opens the file, optionally seeks to the given offset, then returns length bytes (defaulting to the rest of the file). binread ensures the file is closed before returning. The open mode would be “rb:ASCII-8BIT”. IO.binread("testfile") IO.binread("testfile", 20) IO.binread("testfile", 20, 10) binwrite(name, string, [offset] ) => fixnum click to toggle source Opens the file, optionally seeks to the given offset, writes string then returns the length written. binwrite ensures the file is closed before returning. IO.binwrite("testfile", "0123456789", 20) IO.binwrite("testfile", "0123456789") static VALUE rb_io_s_binwrite(int argc, VALUE *argv, VALUE io) { return io_s_write(argc, argv, 1); } copy_stream(src, dst) click to toggle source copy_stream(src, dst, copy_length) copy_stream(src, dst, copy_length, src_offset) ::copy_stream copies src to dst. src and dst is either a filename or an IO. Synonym for IO.new. produces: Parameters¶ ↑ fd
Build Your Own External Hard Drive Step 1: Choose the right enclosure Many newer drives employ SATA, which uses a much smaller connector (above). Older IDE drives connect via two rows of pins (below). Consider two key factors when choosing an enclosure: size and interface. Size is easy: If the drive came from a desktop PC, it's probably a 3.5-inch model—though, if it dates from the late '90s, there's a small chance it could be 5.25-inch. Next, determine the interface your drive uses and look for an enclosure with a matching internal connector. For coverting an internal 3.5-inc IDE hard drive to an external unit, we used a $34.99 X-Craft 350 USB enclosure from Cooler Master. Next, consider the enclosure's external interface—how the box will connect to your PC. Other features to look for in an enclosure include a built-in cooling fan—highly recommended, especially if you'll leave the drive running for long periods. Step 2: Install the drive First, connect the data cable, then press the four-pin power cable into place.