Jump to content

Recommended Posts

Posted

I am using window in a container and the list box doesn't work right. I have it hidden and then visible when a button was pressed. The list box parent is the that page so not tied to any of the other containers that are on top. The issue is I can't interact with it once its displayed on top of the container that has a window in it. 

Any ideas? It won't even scroll. Must be a conflict with the window or maybe the pixmap?

If I use the pixmap image as the drawing routine for the container do I need the window at all? Maybe if I remove the window then the list box will work. 

Posted

I am not quite sure whether I understand your current situation so please forgive me if I am giving a misleading answer.

If you are using the image rendering routine of the container and you are using a pixmap instead of an image then you don't need an additional window to display the pixmap. If you are using the window for anything else then you obviously need it for that thing but the container doesn't require an additional window to use the image rendering routine (with or without using a pixmap as an image).

Posted

Yes, that would be the intended use. Simply assign gwinContainerDraw_Image() as the rendering routine for the container and pass gdispPixmapGetMemoryImage() as the image pointer to the custom parameter of the rendering routine. Should work out of the box and provide you with a lot of joy :)

Posted

Yes, the container has no idea when the content of the pixmap changed. The pixmap is a glorified array of pixel values. It doesn't generate any events or similar. Just call gwinRedraw() once you want to redraw the container using the modified pixmap.

Posted

I am a bit confused. Once you set the image as the draw routine. How do you link it to the pixmap object?

For the container I have

wi.customDraw = gwinContainerDraw_Image;

wi.customParam = gdispPixmapGetMemoryImage;

 

If I want can I set the custom draw later instead of on creation of the widget using gwinSetCustomDraw?

Posted

Do I have to make sure the pixmap is setup before creating the container? Any chance I can get a simple example of setting up the container?

 

I am trying to leave the studio code untouched and then update the container after. I have tried both ways. 

Posted
8 hours ago, MobileWill said:

If I want can I set the custom draw later instead of on creation of the widget using gwinSetCustomDraw?

Yes, you can. Both the custom rendering routine as well as the custom parameter passed to that routine can be set either in the widget init struct or at any time during runtime using gwinSetCustomDraw().

 

7 hours ago, MobileWill said:

Any chance I can get a simple example of setting up the container?

There you go: container_pixmap_example.zip

This is what it should look like:

pixmap_expected_result.png.dc2b7623bcf40

Posted (edited)

Thanks. Looks like I was pretty close. But I am hitting GDISP_IMAGE_ERR_BADFORMAT. Which happened last night. It was unhanded exception and then finally got the GDISP_IMAGE_ERR_BADFORMAT. 

I know the surface works because I can Blit it and it shows correctly. 

I am PM you when my code in a bit.

Edited by MobileWill
Posted

I found the issue. I forgot to increment the Max Files. I meant to do that and then forgot about it. But now my 2nd pixmap is failing.I can say its supper fast having the container handling the image drawing. 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...