[Gambas-user] Getting an objects handler

Bruce Steers bsteers4 at gmail.com
Sat Mar 4 12:01:34 CET 2023


On Sat, 4 Mar 2023 at 04:49, Fabien Bodard <gambas.fr at gmail.com> wrote:

> Do as if the handler and the name was the same.
>
> In the ide it go in this way.
>

Cheers Fab
Gotta love gambas, It only took a moment and i now have Menu.Handler
property :)

But i think i may have over-thought it. the program hasn't been constructed
to the point of restoring the menus yet as I have mostly been working on
saving the info.
I suspect I may not even need the handler name :-\
i sure have needed the Picture.Path property , that's actually really
useful :)
Respects
BruceS



>
> Le ven. 3 mars 2023 à 19:36, Bruce Steers <bsteers4 at gmail.com> a écrit :
>
>>
>>
>>
>> On Fri, 3 Mar 2023, 15:05 Bruce Steers, <bsteers4 at gmail.com> wrote:
>>
>>>
>>>
>>> On Fri, 3 Mar 2023, 12:37 BB, <adamnt42 at gmail.com> wrote:
>>>
>>>>
>>>> On 3/3/23 9:57 pm, Bruce Steers wrote:
>>>>
>>>> Is it possible to get the objects handler name?
>>>>
>>>> Ie. if i use...
>>>>
>>>> Dim m as Menu = New Menu(mParent) As "ThisMenu"
>>>> m.Name = "This"
>>>> m.Text = "This is a menu"
>>>>
>>>> I can read m.Name , m.Text, etc but can i get the "ThisMenu" reference?
>>>>
>>>> I've made a Menu.Save() Menu.Load() function to save/restore menus to
>>>> disk
>>>> It saves all the properties (except Tag yet) but i want to save the
>>>> handler name too.
>>>>
>>>> Many thanks.
>>>> BruceS
>>>>
>>>>
>>>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>>>
>>>> For why?
>>>>
>>>
>>> For Object.Attach() was my thinking
>>>
>>
>> To elaborate....
>>
>> I have a few programs that i have made custom menu creators for. like the
>> new Desktop-ish launcher that is highly customizable. (i attached a snap of
>> the custom menu editor)
>>
>> I want to just Menu.Save(sFileName) and save the menu to file then just
>> as easily restore it.
>> Hmm, actually, thinking about it, I may not need to save the handler name
>> as it will probably be handled inside the program the same.  :-\
>> I got a Menu.Save(Path) method working pretty well. Had to make an
>> addition to Picture.class though, A Picture.Path property that stores the
>> file Path when an image is loaded.
>>  i can save mostly all the menu data including pictures.  (just got to
>> work on Tag variants)
>>
>> For some reason I though having the handler name would be useful.  🤔
>>
>> Respects
>> BruceS
>>
>>
>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230304/42d8b846/attachment-0001.htm>


More information about the User mailing list