Merge pull request #1 from xymus/calculator
authorChanoir <romain.chanoir@viacesi.fr>
Wed, 12 Feb 2014 18:38:14 +0000 (13:38 -0500)
committerChanoir <romain.chanoir@viacesi.fr>
Wed, 12 Feb 2014 18:38:14 +0000 (13:38 -0500)
Small fixes for the calculator example and gtk lib

examples/calculator.nit
lib/gtk3_4/gtk_core.nit

index 2be8aad..35ed125 100644 (file)
@@ -113,9 +113,9 @@ class CalculatorGui
                if user_data isa Char then # is an operation
                        var c = user_data
                        if c == '.' then
-                                       but_dot.sensitive= false
-                                       context.switch_to_decimals
-                                       lbl_disp.text = "{context.current.to_i}."
+                               but_dot.sensitive= false
+                               context.switch_to_decimals
+                               lbl_disp.text = "{context.current.to_i}."
                        else
                                but_dot.sensitive= true
                                context.push_op( c )
index 8cff6b0..a53d08d 100644 (file)
@@ -120,8 +120,6 @@ extern GtkWidget `{GtkWidget *`}
        fun visible: Bool is extern `{
                return gtk_widget_is_visible(recv);
        `}
-
-
 end
 
 #Base class for widgets which contain other widgets
@@ -400,11 +398,14 @@ extern GtkEntry `{GtkEntry *`}
                gtk_entry_set_text( recv, String_to_cstring( value ) );
        `}
 
-       fun visible : Bool is extern `{
+       # Is the text visible or is it the invisible char (such as '*')?
+       fun visiblility: Bool is extern `{
                return gtk_entry_get_visibility( recv );
        `}
 
-       fun visible=( is_visible : Bool) is extern `{
+       # Set the text visiblility
+       # If false, will use the invisible char (such as '*')
+       fun visibility=( is_visible : Bool) is extern `{
                gtk_entry_set_visibility( recv, is_visible );
        `}