1

I'm doing a little app with Quickly and I want to add some windows with different widgets, but the ubuntu-application template just have the options to add a dialog, an indicator, a help-guide and a help-topic. I know it is possible to do so writing the window code directly into the source code, but that way is a little inconsistent with the actual code structure provided by Quickly.

So, I want to know if is possible to add a new window with the existing ubuntu-application template or I have to do it by hand?.

1

2 Answers 2

1

Try adding in some windows using glade:

Open up a terminal, go to your project directory and type "quickly edit" - That will launch glade (gui designer) and it will automatically load in your project's ui files. In glade you can add windows by going to the Toplevels area on the left side and choosing which type of window you want.

To add widgets to that window, you have to put a container of some type into your window. A container will hold the widget basically. Once you have a container you can add as many widgets as it can hold.

If you would like to add windows in using Python:

I would recommend reading this tutorial.

To make a window with a button, try doing something like this:

from gi.repository import Gtk

class ButtonExample(Gtk.Window):
   def __init__(self):
       Gtk.Window.__init__(self, title="Buttons")
       box = Gtk.Box(spacing=6)
       self.add(box)

       button = Gtk.Button("Test Button") #create a button
       button.connect("clicked", self.on_button_clicked) #connect the handler
       box.pack_start(button, True, True, 0)

   def on_button_clicked(self, button): #what happens when button is clicked
       print "Button was clicked!"

win = ButtonExample()
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()
0
quickly add dialog dialogue-name