0
A
回答
1
可以使用GtkFixed容器:
的GtkFixed窗口小部件是可以在固定位置和固定的尺寸,以像素为单位给出放置子控件的容器。
而且因为你没有提到的语言,这里是在Python的例子:
from gi.repository import Gtk
import sys
class MainWindow(Gtk.ApplicationWindow):
def __init__(self, app):
Gtk.Window.__init__(self, title="GtkFixed", application=app)
# Set the window size
self.set_size_request(200, 200)
# Add GtkFixed to the main window
container = Gtk.Fixed()
self.add(container)
button = Gtk.Button("Test Button")
# Add the button in the (x=20,y=100) position
container.put(button, 20, 100)
class Application(Gtk.Application):
def __init__(self):
Gtk.Application.__init__(self)
def do_activate(self):
self.mainWindow = MainWindow(self)
self.mainWindow.show_all()
def do_startup(self):
Gtk.Application.do_startup(self)
application = Application()
exitStatus = application.run(sys.argv)
sys.exit(exitStatus)
(不幸的是我不能发布结果图像)
相关问题
- 1. 如何在qt中设置小部件的绝对位置
- 2. 如何在QT中设置中央小部件的大小/位置
- 3. 如何在窗口中找到GTK小部件的绝对位置?
- 4. PyGTK - 轮询部件位置的GTK表
- 5. 在Text小部件中设置光标位置
- 6. GTKmm - 无法将固定大小设置为Gtk :: Scale小部件
- 7. GTK +设置字体大小
- 8. 如何在位置顶部设置TextField?
- 9. 小部件设置在Flextable
- 10. 如何防止Gtk小部件在设置不敏感时“变灰”?
- 11. 以编程方式设置小部件的位置
- 12. GridLayout + ScrollArea小部件位置大小后的位置
- 13. 如何将小部件放置在Tkinter的Canvas小部件中?
- 14. 如何在WinForms相对位置设置子控件的位置?
- 15. 在QDesigner中设置窗口小部件
- 16. GTK:设置网格的大小C
- 17. gtk + checkbutton设置
- 18. Wirecloud/Fi-ware小部件在小部件设置中包含html
- 19. 如何在Android小部件中设置ImageView的onClicklistener方法?
- 20. 如何在android中捕获小部件位置
- 21. 如何在MKMapView中设置PlaceMark位置?
- 22. 在tkinter文本部件中设置插入字符的位置
- 23. 在AppWidget中设置小部件的外观配置活动
- 24. 获取Android小部件的位置
- 25. GTK:如何设置VBox的高度?
- 26. 如何在GTK中为每个控件设置颜色
- 27. 如何在小部件中获取/设置文本值?
- 28. 如何在UiBinder中为GWT小部件设置ID?
- 29. 如何在Android Studio中为小部件设置高度?
- 30. 我们应该如何在Android中设置小部件值?