[Ohrrpgce] SVN: james/9958 load_plank_from_file() helper function

Ralph Versteegen teeemcee at gmail.com
Fri Jan 12 08:10:09 PST 2018


On 13 January 2018 at 05:04, Ralph Versteegen <teeemcee at gmail.com> wrote:

>
>
> On 12 January 2018 at 13:00, <subversion at hamsterrepublic.com> wrote:
>
>> james
>> 2018-01-11 16:00:45 -0800 (Thu, 11 Jan 2018)
>> 38
>> load_plank_from_file() helper function
>> ---
>> U   wip/plankmenu.bas
>> U   wip/plankmenu.bi
>>
>
> + DIM col as Slice Ptr
> + col = NewSliceOfType(slSpecial)
> + SliceLoadFromFile col, filename
> + IF col = 0 THEN visible_debug "load_plank_from_file: unable to load
> slices from """ & filename & """": RETURN 0
>
> This doesn't work:  if SliceLoadFromFile fails, it doesn't delete col.
>
> I actually have a git branch where I was working on making
> SliceLoadFromFile return a new slice instead of modify an existing one.
> Which was a surprisingly large change. I don't remember why I didn't check
> that in; maybe it didn't seem worth the effort to finish it.
>
> BTW, I have been working on changing the way that plankmenus work. I am
> getting rid of "plank" collections and instead using template slices
> parented directly to the menu slice collection. Oh... I didn't check in
> template slices yet either? Well, it's basically just another Slice bit
> which works very similarly to Slice.Visible. Well, after planks are gone
> maybe plank menus should be renamed... I have a suggestion: Menu Slices. As
> in, promote them to a new slice type so that they can be used by scripts
> too, not just from FB. I have a long writeup about this which I haven't
> finished yet...
>

(I'm not seriously suggesting changing "plank" everywhere in the code, but
I was going to suggest also creating a new "menu item" slice type, and
using that name instead in scripts.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20180113/7bc4d551/attachment.html>


More information about the Ohrrpgce mailing list