Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

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?.

share|improve this question

marked as duplicate by Eric Carvalho, Radu Rădeanu, psusi, Thomas W., user68186 Jun 3 '13 at 18:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
possible duplicated: askubuntu.com/q/155581/62483 –  Lucio Jun 2 '13 at 21:31
add comment

2 Answers 2

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()
share|improve this answer
add comment
quickly add dialog dialogue-name
share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.