No announcement yet.

Issues with inherents

  • Filter
  • Time
  • Show
Clear All
new posts

  • Issues with inherents


    I am working in ViSi. I dropped an Inherent toggle button from the widget tab. I pressed the magic "paste code" button, edited here and there but no matter what I can't make it work. When I try the gfx_switch approach, something begins to show on the screen but it gets erased.

    this is the #Data it creates.
    #inherit "./mainProg.ImgData/"
    //I had to add that ./mainProg.ImgData/ thingy...
    // IToggleInput1 Data Start
    word IIToggleInput1 204, 4, 106, 40, 1, NAVY, WHITE, RED, BLACK, BLACK,
    BLACK, 1, 2, 3, 4, 5, 6, C1IToggleInput1, C2IToggleInput1,
    C3IToggleInput1, -1, 0x0
    byte C1IToggleInput1 "Variable",0
    byte C2IToggleInput1 "fds",0
    byte C3IToggleInput1 "sdf",0
    // IToggleInput1 Data End
    var vIToggleInput1RAM[WIDGET_RAM_SPACE] ;
    This is me trying to show it...
    var hndl_w;
    hndl_w := widget_Create(1);
    widget_Add(hndl_w, 0, vIToggleInput1RAM);
    widget_Enable(hndl_w, 0); // Enable LED 1
    widget_ClearAttributes(hndl_w, ALL, WIDGET_F_INITIALISED);
    //Something is beginnng to show on the screen but it gets erased
    gfx_Switch(0, vIToggleInput1RAM, IIToggleInput1);
    //Tried this
    //int_ToggleInput(1, vIToggleInput1RAM, IIToggleInput1) ;
    //and this
    //img_Show(vIToggleInput1RAM,IIToggleInput1) ;
    I think I have confused the Normal widgets with the internal widgets and the inherent widgets. Is there a simple project/example that has an inherent widget in a ViSi environment that shows/hides the widget and detects touches? I mean I can't find anything here, google or the samples folder...

    That was the original post. I then tried, with success, using some other types of inherents that are using the flash_FunctionCall to display the widgets. All nice and well, but the issue that I have with those is that it works for the first time I call the flash_FunctionCall (the first time for each widget, so if I have 5 widgets, all 5 will be displayed properly), but if I clear the form and try to re-draw those widgets, they don't get drawn again. The rest of the staff are drawn correctly (user controls, texts etc).

    On a side note, how would I detect touches from the flash_FunctionCall widgets, an Inherent Button E for example, other than checking the coords ofc.

    Thank you for reading me and sorry if I am missing something obvious.

  • #2
    If you select 'Inherent widgets' from Topics in the App notes

    It gives you two examples for each of Diablo and Pixxi, they should be able to help you with touch, and may more.

    To 'hide' it you draw it out with a rectangle, or whatever you want to.... And disable it for touch.

    Most of them should only redraw if you change their values, so to get them to redraw after a for change you need to clear the WIDGET_F_INITIALISED attribute.


    • #3
      Mark ftw. Thank you for the reply, so you do need the handler and you are handling them like... well... widgets..... So instead of gfx_randomWidget you flash_func call it, but all the rest are the same, attributes, touches etc. Yeap, starts to make sense now. Thanks again.
      ps to self. App notes you silly sausage... app notes....