Autoglade Tutorial

From Codtech

Under construction

Contents

Introduction

[...]

name overloading

To describe the behavior of some components name overloading is used to be able to insert this from Glade GUI designer.

This commands are currently supported

command args description
mywidget:auto:init: env | gconf | registry initialize widget value
mywidget1:auto:show: mywidget2[,...] show or hide the specified widgets
mywidget1:auto:sensitize: mywidget2[,...] sensitize or desensitize the specified widgets
mywidget:auto:dump name dump values as name
mywidget1:auto:property: mywidget2:prop:val set property prop with value val
mywidget:auto:exec: command:args exec command
mywidget:auto: method:args invoke method

Autoglade command line mode

Mandatory hello world

Glade interface

Design the GUI in glade

There's two things to take into account

  1. assign label1:auto:init:env as label1's name. This tells autoglade that we want this label be initialized from the environent variale label1 and enable Markup.
  2. set the response ID of the close button to -7 (gtk.RESPONSE_CLOSE). This is to obtain the correct exit value from autoglade.

Run it

Now

 $ export label1='<big><big>Hello Autoglade !</big></big>'
 $ autoglade hello_world_1.glade

and you'll get

Image:Autoglade_Tutorial-Hello_World_Example-run.png

More interesting hello world

Glade interface

Design the GUI in glade

There's some things to take into account, as before

  1. assign label1:auto:init:env as label1's name. This tells autoglade that we want this label be initialized from the environment variable label1 and enable Markup.
  2. set the response ID of the close button to -7 (gtk.RESPONSE_CLOSE). This is to obtain the correct exit value from autoglade.
  3. assign image1:auto:init:env as image1's name. This tells autoglade that we want this label be initialized from the environment variable image1 and also set Edit Type as Filename.

Run it

Now

 $ export image1=/usr/share/ubuntu-artwork/img/headerlogo.png
 $ export label1='<big><big>Hello Autoglade !</big></big>'
 $ autoglade hello_world_1.glade

and you'll get

Image:Autoglade_Tutorial-Hello_World_Example_2-run.png