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

On Thu, 2005-10-13 at 10:14 +0200, Jonathan CHABOISSIER wrote:

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 must have missed this mail... no, there shouldn't be any conflict.

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 :

    TEST.obj \
    MyFirstObject.obj \
    MySecondObject.obj \

Concerning the GtkDialog object, you will find informations at and if you are french like me at

It's good that you got it working, but could you repeat why you're not
having the name be a property of the object?  That would do away with
any need for Gtk work and be much more integrated?

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 ?

That's an interesting issue.  I hadn't really considered null actions
when doing the ObjectChange thing.  


Lars Clausen <lars raeder dk>

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