Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 5781

Strange behavior of gx_widget_delete()

$
0
0

Hello,

I´m currently programming a HMI and have a problem with GUIX. I use GUIX in object-oriented c++ and have some Window-Objects in which are GX_WINDOW-Objects, a GX_SCROLLIST and pointer to GX_PROMPT-Objects. I want to display some parameters in the prompts, which are child-objects of the list. 

The thing with the pointer to promts is, that i want my Window-Class to be as small as possible, and therefore i want to recycle/reuse the Prompt-Objects in all of my windows. The prompt-objects are also outsourced to my SDRAM.

The first time i jump in my window - it works, but when i leave the window and jump back, then my list is empty. 

 

Here´s a part of my programm code:

Window-Handler->call(draw-Window)

draw-Window(){
 for (all rows, i++) {
    gx_widget_delete(prompt[i]);
    status = gx_prompt_create(prompt[i], "promptName", &scrollist, GX_ID_NONE, GX_STYLE_ENABLED|GX_STYLE_BORDER_THIN, 600, &sizeListRow);
    status = gx_prompt_text_set(prompt[i], (GX_CHAR*) strbuffer);
  }
}

->showWindow

 

strange thing is, that it works when i delete the gx_widget_delete() function, but then the create-function´s return-value is "Widget already exists". 

It also works if i use memset() to reset my prompt-objects instead of gx_widget_delete(). like this:

 

Window-Handler->call(draw-Window)

draw-Window(){

memset(prompt,0x00,sizeof(*prompt));
 for (all rows, i++) {

    status = gx_prompt_create(prompt[i], "promptName", &scrollist, GX_ID_NONE, GX_STYLE_ENABLED|GX_STYLE_BORDER_THIN, 600, &sizeListRow);
    status = gx_prompt_text_set(prompt[i], (GX_CHAR*) strbuffer);
  }
}

->showWindow

 

Here´s a little picture of my objects:

Thanks

Smithers

 

 


Viewing all articles
Browse latest Browse all 5781

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>