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.

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.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

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.

share|improve this answer
add comment

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()
share|improve this answer
    
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 '12 at 0:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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