Jump to content

gWinContainer


harsha

Recommended Posts

I have 7 windows already (2 or 3 more coming), with same background containing window header and static text on it with name of project; in one of that windows I wanted part of background to be clickable (tap on project name of main window should bring settings window on top). Which other way I can use to be absolutely compatible with µGFX developer's advices? :)

Link to comment
Share on other sites

So we have container in our application which contains label and image widget. We want to make our container to accept click events.

So currently in my code I have

 geventListenerInit(&gl);

gwinAttachListener(&gl);

Do I need to attach any source. If yes can you tell me how??
 

     while(1) {
            pe = geventEventWait(&gl, TIME_INFINITE);
            switch(pe->type) {
                case GMETA_MOUSE_CLICK:  (what is the type I have to check for)
                                 std::cout<<"click"<<std::endl;
                    break;

                default:

                    break;
            }
        }

contianer.png

Edited by harsha
Link to comment
Share on other sites

The proper way of doing this is by implementing a custom rendering routine for the button widget.

In µGFX the widgets are specified by their behavior, not by their appearance. When you need something that is clickable, you take a button and change how it looks. If you need something that takes a range of values, you take a slider and make it look like you want. This is the core philosophy of the µGFX library.
This article explains how you can implement your own custom rendering routine. In fact, the guide is prefect for you because it shows how to create a custom rendering routine for a button that has a label and an image - exactly what you want: http://wiki.ugfx.org/index.php/Creating_a_custom_rendering_routine

If you have more advanced needs, you can even implement your own widget from scratch.

Please do not hesitate to ask if you have any other questions.

Link to comment
Share on other sites

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...