Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Paul McClernan
    @PaulMcClernan
    Adding use com.livecode.canvas gets me the rectangle LCB variable type in a library module, bypassing "syntax is not allowed for this module type" error.
    Would be good if I could bind "<builtin>" to MCRectangleToCGRect, MCGRectangleFromCGRect, maybe they could be added to the LCB objc module? (although technically they're C structs not ObjcObjects)
    Paul McClernan
    @PaulMcClernan
    I never did get any of those binding strings to work, but what I was trying to do (programmatically create and show a Mac native window from scratch, in other words not a stack and no Interface Builder NIB), I did get it working. Mostly the problem was me not understanding enough ObjectiveC/Cocoa.
    Paul McClernan
    @PaulMcClernan
    Actually part of the problem was this binding string, just being in the file not even called by any handler, causes the engine to crash on compile:
    private foreign handler c_CGRectMake(in pX as NaturalFloat,in pY as NaturalFloat, in pW as NaturalFloat, in pH as NaturalFloat ) returns NSRect binds to "c:CoreFoundation.framework>CGRectMake"
    justuni
    @justuni
    Am I correct in the belief that LiveCode allows multiple standalone applications to reuse the listen (accept) port via SO_REUSEPORT for those platforms that allow it?
    Mark Wieder
    @mwieder
    hmmm... I haven't been in these parts for a while, and I thought this was a more direct way to communicate with the team, but I see they haven't been here in months either. I posted a query in the forum almost a month ago looking for some gyp debugging help... I'm compiling the source on an arm7 device so I need to compile the prebuilts locally, and I'm getting the error "gyp: Undefined variable _platform_include_dirs in thirdparty/libffi/libffi.gyp" and I'm not sure where to look to fix the error in the various gyp config files.
    Brian Milby
    @bwmilby
    Prebuilt/third party.gyp?
    Mark Wieder
    @mwieder
    Yeah, that's where I was looking before. It's pretty obvious that I'm falling afoul of one of the combinations of toolset_os and toolset_arch because I'm not getting caught by any of the existing conditional definitions. But I'm at a loss as to how to debug this and figure out what the 'right' combination should be.
    And not having much gyp-fu, I see both 'toolset_os == "linux" or toolset_os == "android"' and 'toolset_os in ("linux", "android")' and they look to me like they do the same thing.
    Brian Milby
    @bwmilby
    And armv7 is listed as an arch
    Could it be the “v”?
    Mark Wieder
    @mwieder
    oh, sorry... meant to say 'armv7' up there.
    Paul McClernan
    @PaulMcClernan
    Hey all, I'm trying, again, to get a MIDI-In buffer going in LCB, now in two separate projects (one is CrossPlatform, Yeah!)... anyway it seems if I could pause or wait the Script engine run-loop, or run my own callback in that loop, it might help syncing / crashing issues I'm having with both projects... it seems there are some undocumented things in the engine LCB module that might be useful
    MCEngineAddRunloopAction(in pCallback as MCRunloopActionCallback, in pContext as optional Pointer, out rAction as MCRunloopActionRef) returns CBool binds to "<builtin>"
    MCEngineRemoveRunloopAction(in pAction as MCRunloopActionRef) returns nothing binds to "<builtin>"
    handler MCEngineRunloopWait() returns CBool binds to "<builtin>"
    foreign handler MCEngineRunloopBreakWait() returns nothing binds to "<builtin>"
    any info about what exactly these are for and exactly how they're used would be much appreciated, T.I.A.
    Paul McClernan
    @PaulMcClernan
    module-engine.cpp uses a function called MCEngineEnsureScriptObjectAccessIsAllowed, which would be great to have exposed in LCB, as sometimes my callbacks throw an error like 'script object access not allowed' when the target script obj is busy / redrawing a widget. I'm thinking this could be used in LCB to check, and if needed wait, before I send my callback 'Post' to the script engine.
    Paul McClernan
    @PaulMcClernan
    I guess if I tried to set/get a ScriptObject's Property from LCB right before, that would confirm access to the Script Object.
    justuni
    @justuni
    I may have completely lost my mind so I need a sanity check. 'put (-1 bitAnd -1)' should be -1 is there something I am missing?
    justuni
    @justuni
    Never mind a "Use the source Luke moment".
    tkbi
    @tkbi

    hey all, I a newbie with LiveCode, and find the software really usefull, to generate event driven tools beside C# or C++.

    For the first start and to understand the workflow rigth I found a really perfekt entrance with :

    Paul McClernan
    @PaulMcClernan
    @trevordevore hey I was looking at some of your widget code and I was wondering if you could explain the quotation marks in your property declaration here? T.I.A. https://github.com/trevordevore/livecode-extensions/blob/5fe918ea07bb12a90ff962d891177223a5e7cd1d/rounded_corners/rounded_corners.lcb#L34
    Paul McClernan
    @PaulMcClernan
    Is it a way to get around a reserved name maybe?
    Trevor DeVore
    @trevordevore
    @PaulMcClernan IIRC it was for using a reserved name. It has been a long time since I wrote it though, and some of the code I wrote was as LCB was evolving. I’m not sure if the quotes would still be necessary or not.
    Paul McClernan
    @PaulMcClernan
    @trevordevore OK, thanks. I just noticed it while looking at something else and thought that's odd. I've been working on a new Widget and trying to mirror properties of built-in objects but experienced some weird behavior using the names like dropShadow, effectColor, etc. for property names. I just renamed the properties something else and added appropriate metadata to get around it. I'll have to go back and see if adding quotes clears up the issues. In my mind ideally things should be consistent in the Property Inspector regardless if it's a Widget or a Built-In object.
    Paul McClernan
    @PaulMcClernan
    I just tested that on LC 9.6 Indy rc1 with the apparently reserved named 'rotation' and adding the quotes did the trick.
    Trevor DeVore
    @trevordevore
    👍🏻
    Brian Milby
    @bwmilby
    One thing I did find is that if there is an alias to the property then you need to use the original name. When I added scroll to the tree view widget I originally tried to use vscroll and couldn’t figure out why it didn’t work.
    Trevor DeVore
    @trevordevore
    Thanks for the reminder @bwmilby. I remember running into the same problem.
    Paul McClernan
    @PaulMcClernan
    @bwmilby that is definitely something I should be aware of, thanks! I've made alias for a few properties in my Piano Widget.

    This doesn't seem to work for me:

    if tPointerA is tPointerB then

    When I log the contents of the two variables of type Pointer they are identical:

    ["Next Pointer=", <foreign pointer 0x7fac7c796260>, "Current Pointer =", <foreign pointer 0x7fac7c796260>]

    Is there a way in LCB to compare two pointers to determine if they point to the same block of memory?
    I looked at foundation.h header file but didn't notice anything like "MCPointerIsPointer()" that could be applicable.

    Or maybe there's a way to dereference or coerce Pointers into another type that I can compare?
    I think a way to convert Pointers to / from a String or a Number would be very useful in a few situations.

    Paul McClernan
    @PaulMcClernan
    binding to this did the trick bool MCValueIsEqualTo(MCValueRef value, MCValueRef other_value);
    justuni
    @justuni
    Is there a function to little-endian big-endian and vise versa?
    Paul McClernan
    @PaulMcClernan
    @justuni in LCB? I don't think so, I rolled my own (for an old PowerPC-era API)
    justuni
    @justuni
    I regular LC?
    I am loading a binary files of different formats each having different 'endian-ness' (if that is a word)
    justuni
    @justuni
    The python function used unpack with "<" and type code 'I'
    def stream_unpack(stream, offset, length, typecode='I'):
    if offset is not None:
    stream.seek(offset)
    data = stream.read(length)
    return struct.unpack('<' + typecode, data)[0]
    '<' is little-endian and 'I' is unsigned int4.
    justuni
    @justuni
    Wrote a quick hack so I can move on. Will return to it later. Thanks, for the help.
    Paul McClernan
    @PaulMcClernan
    @justuni in LiveCode script there is binaryDecode / binaryEncode that you use with tokens that tell it how to deal with bytes/byte ranges, for "endian" things you want either "network byte order" or not.
    Paul McClernan
    @PaulMcClernan
    having issues with *w_char strings in LCB, *char string pointers are no problem but these *w_char pointers don't want to behave the way I expected. I even tried binding to MCStringCreateWithWString found in foundation.h without any joy.
    mengenqing
    @mengenqing
    Hi Paul
    mengenqing
    @mengenqing
    Hi Everyone, I met a problem, I just follow the lesson(https://lessons.livecode.com/m/4071/l/6852-how-to-create-a-rollover-button-with-icon-images) to make a custom button, it can't show in the android Emulator when i test it, and also can't show on the real moblie phone when I save as a standalone application .Is anybody knows the reason or met the similar problem?
    Trevor DeVore
    @trevordevore
    @PaulMcClernan Are you trying to create a string to pass in to an API call or out? The lc-winsparkle repo in my Github account has some examples of using w_char_t with in. Search this page for instances of w_char_t and then you can see the definitions in LCB by finding the foreign handler definition on this page: https://github.com/trevordevore/lc-winsparkle/blob/master/winsparkle.lcb
    Paul McClernan
    @PaulMcClernan
    @trevordevore out currently using memcopy then searching for multiple nulls in a row to find a string terminator / length, which seems to work on macOS but not on Windows (and I don't have a Windows install at the moment to try to debug it myself)
    actually it's in, and the function also takes in a pointer to a buffer that it put's the 'out' into
    Paul McClernan
    @PaulMcClernan
    I don't see any w_char in that winsparkle code
    Trevor DeVore
    @trevordevore
    Paul McClernan
    @PaulMcClernan
    @trevordevore cool thanks, I'll compare that header to your wrapper later, I'm going to try to install Win 10 in under 30 minutes right now.
    @mengenqing you'd probably be better off posting your problem on forums.livecode.com
    mengenqing
    @mengenqing
    @PaulMcClernan Thanks for your reminding. I already got the answer from forums.livecode.com
    Paul McClernan
    @PaulMcClernan
    OK, I think I figured out the problem tapping into this <builtin> function
    MCStringCreateWithWString(const unichar_t *wstring, MCStringRef& r_string);
    Seems like this actually does work fine on Windows, but was crashing the engine on macOS? Not 100% sure but now I have a split if the OS is windows it uses the above, else any other OS it uses my getWCharString (which is a bit hacky, and works by pulling ANSI characters out of the character array and looking for a bunch of nulls in a row for string termination). Bottom line is it's working on both macOS & Windows now.