2

I have just downloaded Quickly, created a new project, set up simple GUI and created new dialog (quickly add dialog create (as you can see, I called it create)). I already have click handler in the main window but I don't know how to open my CreateDialog from there.

P.S. I am new to PyGTK, Glade and Quickly but I am not new to programming overall.

2 Answers 2

6

You can also try to have a look at the help for the add command. You can do either of these:

  • invoke the quickly help add command
  • invoke the quickly tutorial command and browse to the add command reference

From the outupt of quickly help add

For instance 'quickly add dialog dialog-name' will create:

  1. A subclass of Gtk.Dialog called DialogNameDialog in the module DialogNameDialog.py
  2. A glade file called DialogNameDialog.ui in the media/ui directory
  3. A catalog file called *dialog_name_dialog.xml* also in the media/ui directory

To edit the UI for the dialog, run: $ quickly design

To edit the behavior, run: $ quickly edit

To use the dialog you have to invoke it from another python file:

# 1. Import the dialog
import DialogNameDialog

# 2. Create an instance of the dialog
dialog = DialogNameDialog.DialogNameDialog()

# 3. Run the dialog and hide the dialog
result = dialog.run()
dialog.hide()
1
  • Note: quickly add dialog <NewName> ,command adds 'Dialog' to the ending of the file, so do like.. <NewName> make a file call NewNameDialog.ui and new_name_dialog.xml to the '/data/ui' folder ....
    – Voidcode
    Jul 3, 2012 at 0:23
3

First you need to get a hold of the dialog gui object. If I remember correctly, quickly uses glade for the gui and then loads it via the GtkBuilder, so. Get the dialog gui object from the builder

dia = self.builder.get_object('the_name_of_the_dialog_in_glade')

and then you can run it

return_value = dia.run()

the return_value will be a code that corresponds to which button was pressed (which you can change your self in glade) or another code to tell you if the window was destroyed.

Hope it helps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .