0
o1=OptionMenu(calc, conicvalue, 
                "                                                                          Circle                                                                         ", 
                "                                                                          Ellipse                                                                         ", 
                "                                                                          Parabola                                                                         ", 
                "                                                                          Hyperbola                                                                         ", 
                "                                                                        Straight Line                                                                         ")
    o1.place(x=10, y=350)
    o1.config(bg='#2a2d36', fg="#fff", activebackground='#2a2d36', activeforeground='#fff', width=87, borderwidth=0, border=0)
    o1["menu"].config(fg='#2a2d36', bg="#fff", activebackground='white', activeforeground='black')
    o1["menu"].add_command(label=conicvalue.get())
    conicvalue.set("Various Conic Sections")

This is what i've coded however not getting the choice displayed upon the optionmenu. How to fix the issue?

I tried to make an optionmenu which worked well when that was a single app however stop working since i merged the window with another tkinter window.

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
  • I suggest u to switch to PyQt6 + PQt6-Fluent-Widgets (https://github.com/zhiyiYo/PyQt-Fluent-Widgets). It's more reliable and supported than tkinter. – Edoardo Balducci Jul 15 '23 at 09:35
  • @EdoardoBalducci: why do you think tkinter is unreliable? I've found it to be completely reliable. – Bryan Oakley Jul 16 '23 at 18:28
  • A wild guess (since a wild guess is the only thing possible with the complete lack of details you've provided): your two merged apps each has a separate instance of `Tk()`, which means that they have entirely separate sets of Var objects, that simply won't work with widgets living in the other instance. The merger requires that you change one of the `Tk()`s to a `Toplevel()` instead. – jasonharper Jul 16 '23 at 18:34

0 Answers0