Re: eGui idea: Iup Pre-Installed with Euphoria

new topic     » goto parent     » topic index » view thread      » older message » newer message
_tom said...

I have uploaded twelve demo programs. These are IUP examples, originally written in C that come with the IUP source-code, converted to Euphoria. (oE4.1 required.)

Neat, thanks! Curious, what code are you using that requires Euphoria 4.1? I want to catch all of the 4.1-isms and account for them with ifdefs if we can.

_tom said...

I hacked a setup that places the include files in include/iup and I have the IUP binaries in /usr/local. However, we need to agree on a standard installation. I am using the Duro version of 4.1 to run the examples.

I was originally putting the includes into include/std but I have moved them to include/iup. I think we discussed this and it makes more sense this way.

_tom said...

But, I don't understand how to use pixmap graphics (graphical buttons) with your wrapper. Can you try converting button.c to Euphoria?

A pixmap in IUP is just an array of bytes (unsigned char[] in C). You just need to allocate() the size of the array and then poke() it into memory. I've already added a handy-dandy function to my IUP wrapper that does this for you. It is conveniently named allocate_image(). I will work on changing the IupImage functions to accept a sequence of bytes for the pixels parameter as well. That will make it more intuitive. Now that I've shown you this, can you proceed with converting button.c to Euphoria?

constant pixmap_release = allocate_image({ 
    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 
    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2, 
    1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2, 
    1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2, 
    1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2, 
    1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2, 
    1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2, 
    1,1,3,3,3,3,3,3,4,4,3,3,3,3,2,2, 
    1,1,3,3,3,3,3,4,4,4,4,3,3,3,2,2, 
    1,1,3,3,3,3,3,4,4,4,4,3,3,3,2,2, 
    1,1,3,3,3,3,3,3,4,4,3,3,3,3,2,2, 
    1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2, 
    1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2, 
    1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2, 
    1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2, 
    1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 
    2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 
}) 
 
atom img_release = IupImage( 16, 16, pixmap_release ) 
IupHandle( "img_release", img_release ) 

I also noticed in your samples that you are declaring a new type for Ihandle. I know it makes the code look more like the C samples, but I think it's unnecessary and I was trying to avoid this. You can declare all controls as an atom since they are just pointers. This is the same way other Euphoria toolkits work and personally I think it's a lot cleaner looking. I can't find much sense in declaring a new type that doesn't really do anything special.

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu