自学内容网 自学内容网

[Gtk] layout

MediaPlayer

<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <requires lib="gtk+" version="3.20"/>
  <object class="GtkWindow" id="main_window">
    <property name="title">GTK Video Player</property>
    <property name="default-width">1200</property>
    <property name="default-height">600</property>
    <child>
      <object class="GtkBox" id="main_hbox">
        <property name="orientation">horizontal</property>
        <property name="spacing">5</property>

        <!-- Left Sidebar with scrollable content -->
        <child>
          <object class="GtkScrolledWindow" id="scrolled_sidebar">
            <property name="width-request">150</property>
            <property name="hscrollbar-policy">never</property>
            <property name="vscrollbar-policy">automatic</property>
            <child>
              <object class="GtkViewport">
                <child>
                  <object class="GtkBox" id="sidebar">
                    <property name="orientation">vertical</property>
                    <property name="spacing">5</property>

                    <!-- Add 10 Buttons to the sidebar -->
                    <child>
                      <object class="GtkButton" id="Start">
                        <property name="label">Start</property>
                      </object>
                    </child>
                    <child>
                      <object class="GtkButton" id="Pause">
                        <property name="label">Pause</property>
                      </object>
                    </child>
                    <child>
                      <object class="GtkButton" id="Stop">
                        <property name="label">Stop</property>
                      </object>
                    </child>
                    <child>
                      <object class="GtkButton" id="button_4">
                        <property name="label">Button 4</property>
                      </object>
                    </child>
                    <child>
                      <object class="GtkButton" id="button_5">
                        <property name="label">Button 5</property>
                      </object>
                    </child>
                    <child>
                      <object class="GtkButton" id="button_6">
                        <property name="label">Button 6</property>
                      </object>
                    </child>
                    <child>
                      <object class="GtkButton" id="button_7">
                        <property name="label">Button 7</property>
                      </object>
                    </child>
                    <child>
                      <object class="GtkButton" id="button_8">
                        <property name="label">Button 8</property>
                      </object>
                    </child>
                    <child>
                      <object class="GtkButton" id="button_9">
                        <property name="label">Button 9</property>
                      </object>
                    </child>
                    <child>
                      <object class="GtkButton" id="button_10">
                        <property name="label">Button 10</property>
                      </object>
                    </child>
                  </object>
                </child>
              </object>
            </child>
          </object>
        </child>

        <!-- Separator between sidebar and drawing area -->
        <child>
          <object class="GtkSeparator" id="separator">
            <property name="orientation">vertical</property>
          </object>
        </child>

        <!-- Center Video Area -->
        <child>
          <object class="GtkDrawingArea" id="video_area">
            <property name="hexpand">true</property>
            <property name="vexpand">true</property>
          </object>
        </child>

      </object>
    </child>
  </object>
</interface>




原文地址:https://blog.csdn.net/ykun089/article/details/143059248

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!