Re: Popup dialogs



On Sat, 27 Apr 2002 19:35:53 +0100, James <james piku org uk> wrote:

The idea being the CList contains data, and when you double-click on a
row, the "properties" dialog pops up. You then edit the properties,
"OK" the dialog and the CList is updated accordingly.

I can do everything except update the CList. At that point I'm stuck.
There's no widget pointer to pass into lookup_widget(), the only one
relates to the "property" dialog, not the main window.

You use lookup_widget only to inquire about the pointer to the CList.
Once you've got that one, you modify a row by calling gtk_clist_set_row_data
After you called that one, the CList should be updated.


I create the properties dialog in the callback for my clist's
on_foo_select_row(), but once I've shown the window, control continues
(I'm used to the Window$ MFC where you do a .DoModal() and it waits for
you to close the dialog).

You need to explicitly set a window to be modal, by calling a GTK function
the name of which I forgot. However, as you're using Glade, you'd want to
tell Glade to call it for you. Look up the Properties dialog in Glade for
the topmost widget of your dialog, there is a button labeled "Modal"


Is the easiest way to declare a global variable that points to my main
window and use that? or is there a better way?

It really depends on what you wanna do with the window. I try to avoid
keeping globals pointing to secondary windows, but sometimes it is handy. 
For the main window, I think it is a good idea to do so in any case.


Cheers  Peter
-- 
      Dr. Peter Rottengatter       peter rottengatter de
                                   http://www.rottengatter.de

 PGP fingerprint : FD8C 16E5 25CB ED06 43FD  3A0F 11AD E2F8 E89A 83E8



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]