devxlogo

PowerBuilder dynamic menus

PowerBuilder dynamic menus

Question:
We want to create menus dynamically where we store the menu items in a table. While running the application, we want to read the values from the table and build the menu dynamically.

Answer:
This is not possible using the standard PowerBuilder menu objects. There are several workarounds to the problem.

The first is to use a tree control for naviagation. You could also use a listview with icons representig the options the user can select.

The last option, which is the option I have personally used is to build fake menus with a window and a custom control. I used the datawindow control with each row representing an item in the menu. I then used lines to draw a 3D edge and dynamically resized the control based on the size of the widest text and the number of rows in the datawindow. It was very effective and you could not tell the difference between the fake and a real menu.

See also  Why ChatGPT Is So Important Today
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist