You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to set the font of the title of a window as font1 and any other items as font2. I know I can achieve this as follow:
importdearpygui.dearpyguiasdpgdpg.create_context()
withdpg.font_registry():
withdpg.font(...) asfont1:
...
withdpg.font(...) asfont2:
...
dpg.bind_font(font1)
...
withdpg.window(...) aswindow1:
item1=dpg.draw_line(...)
item2=dpg.add_text(...)
item3=dpg.add_button(...)
...
# set the font of all the items one by onedpg.bind_item_font(item1, font2)
dpg.bind_item_font(item2, font2)
dpg.bind_item_font(item3, font2)
...
...
But such codes seems really stupid. I wonder is there any function in dpg that can get a tag referring to the "item" of the title of the window, so that I can use code like this:
importdearpygui.dearpyguiasdpgdpg.create_context()
withdpg.font_registry():
withdpg.font(...) asfont1:
...
withdpg.font(...) asfont2:
...
dpg.bind_font(font2)
...
withdpg.window(...) aswindow1:
title_id= ... # get the tag of the window title "item"dpg.bind_item_font(title_id, font1)
# or something like dpg.set_title_font(font1)item1=dpg.draw_line(...)
item2=dpg.add_text(...)
item3=dpg.add_button(...)
...
# the font of the rest of items are set to font2 by default
...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to set the font of the title of a window as
font1
and any other items asfont2
. I know I can achieve this as follow:But such codes seems really stupid. I wonder is there any function in dpg that can get a tag referring to the "item" of the title of the window, so that I can use code like this:
Beta Was this translation helpful? Give feedback.
All reactions