python - How can I put 2 buttons with images Vertically in a frame -
im using tkinter , trying create toolbar located on left side going vertically, have toolbar on top of frame filled in going horizontaly can't figure out how make second 1 on left, buttons.
this code have:
infobar = frame(master, bg="#ecf0f1", bd=1, relief=groove) infobar.pack(side=left, fill=both, expand=none) infobarr = label(toolbar, bg="#ecf0f1", text=' ') infobarr.pack(side=left, fill=y) poundtokgbutton = button(infobar, highlightbackground="#ecf0f1", image=eimg20, relief=flat, command=self.scale) poundtokgbutton.image = eimg20 createtooltip(poundtokgbutton, "conversion - pound kg") poundtokgbutton.pack(side=left) calculatorbutton = button(infobar, highlightbackground="#ecf0f1", image=eimg19, bd=1, relief=flat, command=self.calc) calculatorbutton.image = eimg19 createtooltip(calculatorbutton, "calculator") calculatorbutton.pack(side=left, anchor="sw")
use side=top
if want things stacked vertically. containing widget has empty space. when use pack
, you're telling tkinter side of empty space put widget.
here example of happens when call pack: http://tcl.tk/man/tcl8.5/tkcmd/pack.htm#m26
Nice articles -
ReplyDeletePython cv2.gaussianblur
how to add multiple markers on google maps javascript
Python program to convert celsius to fahrenheit
Display emoji unicode characters in php
Export data from MySQL table to CSV file using PHP