2023-11-01 08:00 AM
Hi, I recently got this board and learning about it. My demo application will be for Cortex-A7 core with linux.
I need to make application which takes input from user say I have Menu with 5 choices and user can provide the choice number.
How can I configure this? I am looking for any examples if available.
Do I need to configure any pins and re-build the kernel?
Any help will be appreciated, Thank you.
Solved! Go to Solution.
2024-06-07 11:26 AM
Implemented my own C application for the demo.
2024-04-05 07:41 PM - edited 2024-04-05 07:44 PM
u can run applycation with python3
code
import gi
from gi.repository import Gtk
class MenuWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="Menu Demo")
self.set_default_size(300, 200)
self.set_border_width(10)
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
self.add(vbox)
# Tạo menu bar
menubar = Gtk.MenuBar()
vbox.pack_start(menubar, False, False, 0)
# Tạo menu "Options" và các mục con
options_menu = Gtk.Menu()
options_menu_item = Gtk.MenuItem(label="Options")
options_menu_item.set_submenu(options_menu)
for i in range(1, 6):
menu_item = Gtk.MenuItem(label=f"Option {i}")
options_menu.append(menu_item)
menu_item.connect("activate", self.on_option_clicked, i)
menubar.append(options_menu_item)
def on_option_clicked(self, widget, option_number):
print(f"Option {option_number} clicked")
if __name__ == "__main__":
win = MenuWindow()
win.connect("destroy", Gtk.main_quit)
win.show_all()
Gtk.main()
2024-06-07 11:26 AM
Implemented my own C application for the demo.