Re: [Programmed Object] Integrate my own Dialog Window in a callback function from right-clic menu




The user must select my object and right click on a Connection Box, then there would be in the menu an activated item "Rename ConnectionBox" (in case he clicked well of course) which would create a window where the user could fill the name.

For the moment, I think I must create and define a GtkWidget in the callback function. But in the first hand I wonder if there are somethings like this already exists in Dia (I searched the code corresponding to the properties dialog window with no result), and in the other hand I want to ask if there could be a kinf of "Gtk Conflict problem" if I try to create a pop-up widget by myself...
I managed to program what I wanted. I finally had to use a GtkDialog and I had no problem with this. In the makefile, because I am now using Gtk objects in my own code, I added the line : PKG_LINK = $(PKG_LINK) $(GTK2_LIBS) to link with Gtk2 libraries.

Example :

!IFDEF OBJ_TEST
OBJECTS = \
    TEST.obj \
    MyFirstObject.obj \
    MySecondObject.obj \
PKG_LINK = $(PKG_LINK) $(GTK2_LIBS)
!ENDIF

Concerning the GtkDialog object, you will find informations at http://www.gtk.org/tutorial/x882.html and if you are french like me at http://www.gtk-fr.org/wakka.php?wiki=LesBoitesDeDialogue

However, I have now an new problem which does not come from Gtk.

The dialog window is defined in a right clic callbcack function, and this kind of function must return a ChangeObject. In my Dialog, I want to allow the user to "Cancel" the operation, and in thtat case, I do not change anyhting. If the function returns a NULL value, Dia tells me "This object doesn't support Undo/Redo. Undo information erased." and thus the previous operations can not be cancelled.
I could of course create an ObjectChande which would do nothing, but the user may think it is strange if when he tries to cancel the first time he does not see anything coming back.

What do you think I should do ?

Thanks!

Jonathan Chaboissier


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