OWN GUI creation...Probelm with dynamic memory allocation

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

OWN GUI creation...Probelm with dynamic memory allocation

836件の閲覧回数
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 返信

829件の閲覧回数
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 件の賞賛
返信