No announcement yet.

gen4-28dt display: how to create a button using a user - defined height and width ?

  • Filter
  • Time
  • Show
Clear All
new posts

  • gen4-28dt display: how to create a button using a user - defined height and width ?

    I want to create and view a button using the serial environment width a user defined size.
    Is there a possibility to create such a button ?

    The function gfx_Button2() isn't included in the serial C - library.

  • #2
    Hello idexcorp-user,

    Yes, that's possible, by using other functions such as gfx_Panel() and gfx_Rectangle(). These can be used to create a simple button with a user-defined size and superimposed text.

    Unfortunately, gfx_Button2() is not included, but you can call gfx_Button() inside gfx_Button2().

    The pseudocodes are shown below for your reference:

    Approach 1:

    void gfx_Button2(...) {
    // Draw a button by using gfx_Button(...) function

    Approach 2:

    void gfx_Button2(...) {
    // Draw a panel
    // Put a text

    For your reference, I have attached an Arduino sketch (if you have an Arduino board) that uses the Diablo_Serial_4DLib library.This demonstrates how to create and show a button and how to implement touch detection.

    If you are using a different platform, it is helpful to check the Diablo16-Serial-C-Library here:

    Hopefully, this will help you.

    Best regards,

    Attached Files


    • #3
      Thank you for your fast reponse !

      I solved the Problem using the function gfx_Rectangle() and it functions now as I expected.

      Again; Thank you for your fast reponse and your tips to solve the problem !

      Greetings to you from Germany !



      • #4
        You're welcome idexcorp-user.

        We're glad that you solved the problem.
        We'd love to continue providing solutions to awesome customers like you.
        If you have queries, please don't hesitate to ask.

        All the best,