This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LM4F232 Eval Kit Display widget

Hi,

I have been looking at the widgets to be used for the small OLED display on the LM4F232 Eval Kit. 

I have already declared the widgets as show:

//Graphics Widget
extern tCanvasWidget g_sBackground;

//background widget
Canvas(g_sBackground,
WIDGET_ROOT,
0,
0 ,
&g_sCFAL96x64x16,
0,
0,
96,
64,
CANVAS_STYLE_FILL,
ClrBlue,
0,
0,
0,
0,
0,
0);

and in the Main, I have initialize the canvas and add it onto the Root Widget:

CanvasInit(&g_sBackground,&g_sCFAL96x64x16,0,0,96,64);
WidgetAdd(WIDGET_ROOT,(tWidget *)&g_sBackground);

However, when I tried the WidgetPaint:

WidgetPaint((tWidget *)&g_sBackground);

The display did not move. Is there any settings that I did not do correctly?

  • It looks to me as if you are trying to fill the screen with a single blue rectangle. Is that correct?

    The main thing I see here which is incorrect is that you do not need to call CanvasInit() if you previously used the Canvas() macro to instantiate the widget since this already initializes all the fields that CanvasInit() sets. The macro allows build-time initialization of widgets whereas the function allows you to create widgets at runtime.

    That said, calling CanvasInit() should be safe since you are initializing fields to the same values that you set them to in the Canvas() macro so that's not the cause of the problem. You seem to have created the canvas widget correctly in the macro.

    The only thing I can think of (without further information) is that you are not calling WidgetMessageQueueProcess() after WidgetPaint(). The WidgetPaint() function doesn't actually perform the painting operation. All it does is post a message on the widget message queue telling it to paint itself. The actual painting takes place once the message is read from the queue and processed. All widget applications must call WidgetMessageQueueProcess() regularly from their main loop to ensure that widget updates and touchscreen messages are processed correctly.

  • that's correct Dave! 

    I have been wondering why didn't the WidgetPaint() didn't work... Now that I've added in the WidgetMessageQueueProcess(), It worked!

    THANKS A LOT!!! 

  • @ Dave W,

    Another satisfied client - bravo. 

    Your "classification" as "Mastermind" much like classing Ferrari as, "2-door, passenger vehicle." 

    (And might there be, "MsgQueueProcess(Speeding_Ticket_Delete)" in the works?)