Le 03/12/2013 00:41, Jesus a écrit :
> El 01/12/13 16:54, Jesus escribió:
>> Hi all
>>
>> I'm trying to get up and running a project which have a Toolbar and some
>> toolbuttons in it. I'd like to mimic the same behavior toolbars have in
>> Gambas' IDE. I've read the docs about Toolbar (gb.form.mdi) but calling
>> the configure method throws an error aborting my application.
>> BTW, all the toolbuttons have set an Action property, but note that I
>> haven't any workspace in the main form, just the toolbar.
>>
>> This is the code I'm using in a minimal test application:
>> ------8<----------------------------------
>> Public Sub ToolBar1_MouseDown()
>>
>>        If Mouse.Right Then ToolBar1.Configure
>>
>> End
>> ------8<----------------------------------
>> The error text is in the 'Toolbar1.Configure' line: "Not an object"
>> The stack back-trace:
>>
>> FToolBarConfig.InitAction.108
>> FToolBarConfig.SetCurrentToolBar.54
>> FToolBarConfig.Run.17
>> Action._ConfigureToolBar.21
>> ToolBar.Configure.34
>> FMain.ToolBar1_MouseDown.20
>>
>> What am I doing wrong?
>
> Finally I've found what I was doing wrong. The 'Key' toolbar's property
> *must* be set with a unique name. Failing to do this, will lead to a
> dumb toolbar. No need to call Configure from a mouse event. Hope this
> helps someone else.
>
> Regards
>
>

I have added an explicit error message if the Configure() method is 
called without Key being defined.

Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to