开发者

Can I load an image file into "GTk-glad" Tool as a GUI frame to work on it?

开发者 https://www.devze.com 2023-02-21 03:20 出处:网络
I know that \"GtK-glade\" got many convinent sample GUI frame like Management UI, there are many samples using t开发者_开发技巧he template of Glade\'s inside tool, like buttons, menus, label.

I know that "GtK-glade" got many convinent sample GUI frame like Management UI, there are many samples using t开发者_开发技巧he template of Glade's inside tool, like buttons, menus, label.

But I had like to use my own frame of GUI to be costumerized for users.And I just can't find a way to load my own "image" of frame from the "Glade" tool.

By What method can I let my one "image" of frame to replace the sample frame of "Glade" tool?

Or by what kind of "GtK" glade-like tooling can do this job?

I use c souce code of Ubuntu linux. And I can't find an toolkit to update my original souce code of GUI. I only find that GTK-glade can open it .


int
main (int argc, char *argv[])

..........

 GtkImage        *image = NULL;

 image = glade_xml_get_widget (gxml, "image1");

 gtk_image_set_from_file(image,"tux.png");

my glade xml file is:

    <?xml version="1.0"?>
<glade-interface>
  <!-- interface-requires gtk+ 2.6 -->
  <!-- interface-naming-policy toplevel-contextual -->
  <widget class="GtkWindow" id="window1">
    <property name="visible">True</property>
    <property name="border_width">10</property>
    <property name="title" translatable="yes">window1</property>
    <property name="default_width">800</property>
    <property name="default_height">480</property>
    <signal name="destroy" handler="on_window1_destroy"/>
    <child>
      <widget class="GtkVBox" id="vbox2">
        <property name="visible">True</property>
        <property name="spacing">2</property>
        <child>
          <widget class="GtkEntry" id="entry1">
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="invisible_char">&#xE2;</property>
          </widget>
          <packing>
            <property name="expand">False</property>
            <property name="fill">False</property>
            <property name="position">0</property>
          </packing>
        </child>
        <child>
          <widget class="GtkButton" id="button1">
            <property name="label" translatable="yes">Hello</property>
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="receives_default">False</property>
            <property name="use_underline">True</property>
            <signal name="clicked" handler="on_button1_clicked"/>
          </widget>
          <packing>
            <property name="expand">False</property>
            <property name="fill">False</property>
            <property name="position">1</property>
          </packing>
        </child>
        <child>
          <widget class="GtkLabel" id="label1">
            <property name="visible">True</property>
            <property name="label" translatable="yes">label</property>
          </widget>
          <packing>
            <property name="position">2</property>
          </packing>
        </child>
        <child>
          <widget class="GtkImage" id="image1">
            <property name="visible">True</property>
            <property name="stock">gtk-missing-image</property>
          </widget>
          <packing>
            <property name="position">3</property>
          </packing>
        </child>
      </widget>
    </child>
  </widget>
</glade-interface>
0

精彩评论

暂无评论...
验证码 换一张
取 消