/src/wrappers/gtk/examples/gtk-demo/expander.e
Specman e | 81 lines | 58 code | 23 blank | 0 comment | 5 complexity | 10700c44c6a42e8f9d37158d03915cc8 MD5 | raw file
1indexing 2 description: "." 3 copyright: "[ 4 Copyright (C) 2006 eiffel-libraries team, GTK+ team 5 6 This library is free software; you can redistribute it and/or 7 modify it under the terms of the GNU Lesser General Public License 8 as published by the Free Software Foundation; either version 2.1 of 9 the License, or (at your option) any later version. 10 11 This library is distributed in the hope that it will be useful, but 12 WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 Lesser General Public License for more details. 15 16 You should have received a copy of the GNU Lesser General Public 17 License along with this library; if not, write to the Free Software 18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 19 02110-1301 USA 20 ]" 21 22class EXPANDER 23 24inherit DEMO 25 26insert 27 GTK_RESPONSE_TYPE 28 GTK_STOCK_ITEMS 29 30creation make 31 32feature 33 34 name: STRING is "Expander" 35 36 description: STRING is "GtkExpander allows to provide additional content that is initially hidden. This is also known as %"disclosure triangle%"." 37 38 filename: STRING is "expander.e" 39 40feature -- widgets 41 vbox: GTK_VBOX 42 label: GTK_LABEL 43 expander: GTK_EXPANDER 44 45feature 46 make is 47 do 48 if window=Void then 49 create {GTK_DIALOG} window.with_buttons ("GtkExpander", -- Window label 50 parent_window, 51 0, -- no flags 52 <<gtk_stock_close, 53 gtk_response_none>>) 54 window.set_unresizable 55 56 create vbox.make (False, 5) 57 window.vbox.pack_start (vbox, True, True, 0); 58 vbox.set_border_width (5) 59 60 vbox.pack_start (create {GTK_LABEL}.with_label 61 ("Expander demo. Click on the triangle for details."), 62 label, False, False, 0) 63 64 create expander.make ("Details") 65 vbox.pack_start (expander, False, False, 0) 66 67 expander.add (create {GTK_LABEL}.with_label("Details can be shown or hidden.")) 68 69 if not window.is_visible then 70 window.show_all (window) 71 else 72 window.destroy 73 end 74 end 75 end 76end 77 78 79 80 81