Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

FrameBox heights wrong when turning Xwt-Gtk3 widgets to Gtk3 #843

Open
directhex opened this issue Jul 27, 2018 · 1 comment
Open

FrameBox heights wrong when turning Xwt-Gtk3 widgets to Gtk3 #843

directhex opened this issue Jul 27, 2018 · 1 comment

Comments

@directhex
Copy link
Contributor

using System;
using Xwt;

class xwt3test
{
	[STAThread]
	static void Main () {
		Application.Initialize("Xwt.GtkBackend.GtkEngine, Xwt.Gtk3, Version=1.0.0.0");
        var mainWindow = new Gtk.Window("Xwt/Gtk Demo Application")
        {
            Title = "Xwt Demo Application",
            WidthRequest = 500,
            HeightRequest = 400
        };
		Gtk.VBox vbox1 = new Gtk.VBox();
		Xwt.VBox infoBox = new Xwt.VBox()
        {
            CanGetFocus = false
        };
        Xwt.FrameBox mbox = new Xwt.FrameBox(infoBox)
        {
            CanGetFocus = false
        };
		vbox1.PackStart((Gtk.Widget)Xwt.Toolkit.CurrentEngine.GetNativeWidget(mbox), false, false, 0);
		infoBox.PackStart(new Label("test1"));
		infoBox.PackStart(new Label("test2"));
		infoBox.PackStart(new Label("test3"));
		infoBox.PackStart(new Label("test4"));
		infoBox.PackStart(new Label("test5"));
		mainWindow.Add(vbox1);
        mainWindow.ShowAll();
        Application.Run();
        mainWindow.Dispose();
	}
}

Results in:

screenshot from 2018-07-27 13-41-58

A pure Xwt approach is fine, i.e.

using System;
using Xwt;

class xwt3test
{
	[STAThread]
	static void Main () {
		Application.Initialize("Xwt.GtkBackend.GtkEngine, Xwt.Gtk3, Version=1.0.0.0");
        var mainWindow = new Window()
        {
            Title = "Xwt Demo Application",
            Width = 500,
            Height = 400
        };
		Xwt.VBox infoBox = new Xwt.VBox()
        {
            CanGetFocus = false
        };
        Xwt.FrameBox mbox = new Xwt.FrameBox(infoBox)
        {
            CanGetFocus = false
        };
		infoBox.PackStart(new Label("test1"));
		infoBox.PackStart(new Label("test2"));
		infoBox.PackStart(new Label("test3"));
		infoBox.PackStart(new Label("test4"));
		infoBox.PackStart(new Label("test5"));
		mainWindow.Content = mbox;
        mainWindow.Show();
        Application.Run();
        mainWindow.Dispose();
	}
}

leads to

screenshot from 2018-07-27 13-45-27

This is why the text in Help/About in MonoDevelop-Gtk3 is broken.

@directhex directhex changed the title VBox heights wrong when turning Xwt-Gtk3 widgets to Gtk3 FrameBox heights wrong when turning Xwt-Gtk3 widgets to Gtk3 Jul 27, 2018
@directhex
Copy link
Contributor Author

It's the Xwt.FrameBox - putting the Xwt.VBox directly into the Gtk.VBox is fine, putting the Xwt.FrameBox containing the Xwt.VBox into the Gtk.VBox causes the compression issue above.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant