OWN GUI creation...Probelm with dynamic memory allocation

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

OWN GUI creation...Probelm with dynamic memory allocation

877 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpc_learner on Thu Apr 12 02:54:47 MST 2012
hi everybody,
I know that there are several GUI are available with free of cost, but i am just creating my own gui with a small set of widgets. Up to now i managed to create the drawings of widgets. Now, i've to add the properties of each widget. so that i am creating a structure for each widget to store the properties.like this..


// structure for edit text widget
typedef struct{

int iLocX;
int iLocY;

const unsigned char* string;  // to store the string which i am going to display in my edit text widget


}edit_text_widget;


create_edit_text_widget(int locX,locY,char* name,unsigned char* str_to_display)
{
edit_text_widget* edit_text_info;

draw_editWidget(iLocX,iLocY);

edit_text_info = (edit_text_widget*)malloc(sizeof(edit_text_info));

// with out above statement my widget is printing on TFT..but,
// with this statement, TFT is not at all intialising..controll is not all coming to main function itself

}


how to allocate the memory for this structure...If any doubts on this question,let me know..
If any one get this, please help me out...

Sorry for poor English..

Thanks in advance..
标签 (1)
0 项奖励
回复
1 回复

870 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpc_learner on Thu Apr 19 21:02:25 MST 2012
Hi all,

I found the solution for that.Now, i managed to use malloc function ...

Thank u all
0 项奖励
回复