Hello,
I work to an project and I want to modify the text from label without success.
I attached my code.
Please explain how should I proceed in order to modify the text from label.
I use MikroBasic, Visual GLCD and EasyPIC5 with PIC18F4550 at 8MHz.
Thank you,
Mihai
Modify Label with custom text nor working
-
- Posts: 28
- Joined: 20 Jul 2010 13:56
Modify Label with custom text nor working
- Attachments
-
- Test 02-04-2018.zip
- (205.35 KiB) Downloaded 120 times
- strahinja.jacimovic
- mikroElektronika team
- Posts: 200
- Joined: 18 Dec 2017 18:19
Re: Modify Label with custom text nor working
Hi,
Have you checked our examples from within the compiler?
There are a couple for GLCD where you can see how this is done.
Kind regards,
Have you checked our examples from within the compiler?
There are a couple for GLCD where you can see how this is done.
Kind regards,
Strahinja Jacimovic
-
- Posts: 28
- Joined: 20 Jul 2010 13:56
Re: Modify Label with custom text nor working
Hello,
Thank you for response.
Yes, I checked and the examples from MikroBasic compiler work very well.
My problem is with Visual GLCD: the label text is not changed if I modify the follow lines:
Label1.Caption = @Label1_Caption
Label1_Caption = "qwer"
So, please, provide me an short example of this action.
Please see my attachment, maybe I am doing something wrong there.
And, your example is only for that big GLCD; I use the small one, 128x64.
Thank you,
Mihai
Thank you for response.
Yes, I checked and the examples from MikroBasic compiler work very well.
My problem is with Visual GLCD: the label text is not changed if I modify the follow lines:
Label1.Caption = @Label1_Caption
Label1_Caption = "qwer"
So, please, provide me an short example of this action.
Please see my attachment, maybe I am doing something wrong there.
And, your example is only for that big GLCD; I use the small one, 128x64.
Thank you,
Mihai
- strahinja.jacimovic
- mikroElektronika team
- Posts: 200
- Joined: 18 Dec 2017 18:19
Re: Modify Label with custom text nor working
Hi,
I was able to create a simple example.
Basically, it's the same as yours. I just added this piece of code in the events part.
Basically, whenever I click on the button, the caption of the label will change to NEW.
I did this on a PICv7 board using PIC18F45K22, but it should work on yours as well.
Kind regards,
I was able to create a simple example.
Basically, it's the same as yours. I just added this piece of code in the events part.
Code: Select all
//--------------------- User code ---------------------//
void updateLabel(TLabel *lbl, char *str)
{
Glcd_Write_Text_Adv(lbl->Caption, Label1.Left, Label1.Top);
strcpy(lbl->Caption, str);
DrawLabel(lbl);
}
//----------------- End of User code ------------------//
// Event Handlers
void Button1OnClick()
{
char str[20] = {'N','E','W'};
updateLabel(&Label1,&str);
}
I did this on a PICv7 board using PIC18F45K22, but it should work on yours as well.
Kind regards,
Strahinja Jacimovic
-
- Posts: 28
- Joined: 20 Jul 2010 13:56
Re: Modify Label with custom text nor working
Hello,
Thank you for your support.
It works!
Thank you for your support.
It works!