1

I am usin DearPyGui to offload the work to my GPU. I want to create a simple window with a logo on it but I can't seem to find why it is not working. Here's the code :

from dearpygui.core import *
from dearpygui.simple import *

set_main_window_size(700, 700)
set_global_font_scale(1.25)
set_theme("Dark")
set_style_window_padding(30,30)

with window("Automated test", width = 640, height = 640):

    print ("Lancement des autotests")
    set_window_pos("Automated test", 0, 0)
    add_drawing("logo", width = 500, height = 500)

draw_image("logo", "Logo_company.png", [0, 240])


start_dearpygui()

For some reason, I get this error :

 File "/usr/local/lib/python3.7/dist-packages/dearpygui/simple.py", line 112, in menu_bar
    yield internal_dpg.add_menu_bar(name, show=show, parent=parent, before=before)

SystemError: <built-in function add_menu_bar> returned a result with an error set

Which is the same for any method from DearPyGui I try to summon after set_window_pos

Does anyone know what is wrong with what I wrote ?

Mathieu
  • 11
  • 2

1 Answers1

0

As I'm on the same path as you, i've found this answer : https://www.reddit.com/r/DearPyGui/comments/ml2xj9/this_is_my_first_time_using_dearpygui_also_a/

In substance :

There are four mandatory parameters to use in the draw_image command.

drawing : str
file : str
pmin : List[float]
pmax : List[float]

Pmin and pmax control from where to where the image is drawn.

You can find more info on this command here: https://hoffstadt.github.io/DearPyGui/api_core.html#dearpygui.core.draw_image

And :

example : raw_image('logo', 'logo_spamFilter.png', (0, 0),(458, 192))

Abhishek Rai
  • 2,159
  • 3
  • 18
  • 38
Fabien
  • 1
  • 1
  • Hi, I have since solved my issue. So, yes, my code lacked theses parameters, but also, I had some weird issues with my interpreter (Spyder 3 on Debian) and got it working after launching it 3 times in a row. I am not sure what was to fault for this, now it is lost in my main code so I can't easily troubleshoot. One thing I would advise to check, though, is if the start_dearpygui() is correctly indented since I have had issues with that and they were giving me the same error. – Mathieu May 20 '21 at 07:06