[Gambas-user] A Beginner's Guide to Gambas

Scott Castaline hscast at ...407...
Mon Jul 2 22:52:59 CEST 2007


Scott Castaline wrote:
> Charlie Reinl wrote:
>> Salut,
>>
>> may be there are some more typo.
>> But for your pb. Are you using Gambas 1.x (not 1.9.x) ?
>>
>> Amicalment 
>> Charlie
>>
>> Am Samstag, den 30.06.2007, 19:25 -0400 schrieb Scott Castaline:
>>> Anyone familiar with this book, written by Dr. John W. Rittinghouse? I 
>>> am having a problem with one of the examples in Chapter 4. The example 
>>> creates a method for a button that is created in the forms sub. When 
>>> running the code it'll come up with "button.hide is not static" and 
>>> gives the option to stop or continue. Did I miss the boat or is there 
>>> another typo in the book? I had already found one typo in this example.
>>>
>>> TIA
>>>
>>> -------------------------------------------------------------------------
>>> This SF.net email is sponsored by DB2 Express
>>> Download DB2 Express C - the FREE version of DB2 express and take
>>> control of your XML. No limits. Just data. Click to get it now.
>>> http://sourceforge.net/powerbar/db2/
>>> _______________________________________________
>>> Gambas-user mailing list
>>> Gambas-user at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>>
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
> FC6 repos have 1.0.17, which is where I got Gambas from. Installed from 
> their rpm(s). If you have the book the particular example is on page 71. 
> I found that the first typo was in the use of button1.hide should be 
> button.hide, since that is what was created in the main sub.
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 
I still can't seem to figure out this example from the book. Here is the 
code as I have it:
' Gambas class file

PUBLIC SUB Form_Open()
     DIM hButton AS Button
     hButton = NEW Button (ME) AS "hButton"

     hButton.X = 120
     hButton.Y = 60
     hButton.Width = 200
     hButton.Height = 40
     hButton.ForeColor = Color.Cyan
     hButton.BackColor = Color.Red
     hButton.Font.Bold = TRUE
     hButton.Enabled = TRUE
     hButton.Text = "Click or press ESC to Quit"
     hButton.ToolTip = "Hey! Back off!"
     hButton.Border = TRUE
     hButton.Default = TRUE
     hButton.Cancel = TRUE
     hButton.Show
END

PUBLIC SUB hButton_Click()
   Button.Hide
   Label.Text = "Hey! Watch that!"
   WAIT 2.0
   Button.Show
   Label.Text = "Ahh! So good!"
END

When I click on the button created by the main sub I'll get the error of 
"Button.Hide is not static". I don't understand what it is trying to 
say. I thought that Button.Hide was a Method that actually make calls to 
built in Subs, or do I need to actually add in code for Hide and Show as 
subs from the hButton_Click sub? Or am I really out in left field?




More information about the User mailing list