Hi,
thanks for your very in depth answer. I just got to try this two days ago
and got it working!. I've added a few more points to the existing polyline
inside continue_stroke() to create an arrow head. Now I wanted to switch
between the ordinary ruler and my modified one. This was quite a hurdle and
certainly isn't nice looking code. I didn't want to create a new tool from
scratch, as that would have taken a lot longer. Instead I added a new int
to the UIData struct, that serves as a switch for the different "ruler
tools". This int can be modified by a GtkMenuToolButton in the toolbar,
which has multiple radio items (the button itself does nothing). All these
items are connected to the same handler and by comparing the sender's label
to strings the int value gets set (What could possibly go wrong? Well
translation is an issue for sure. I think there is a possibility to send
this data over the gpointer user_data, but I didn't try that one). With
this information I can select the tool that will be applied
inside continue_stroke(). Currently the UI looks like this (i don't know if
embedded pictures will work here):
[image: Inline-Bild 1]
[image: Inline-Bild 2]
Its not really clean and forward, but I have to leave it at that for now.
Changing the ruler toggle button into a radio control required changing
code in parts of Xournal that caused a myriad of new problems. I didn't
want to face those without a debugger.
Maybe you have a better idea on how to handle all this. As it is now, I'm
quite happy as these were my most wanted features.
Thanks again,
Mo.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Xournal-devel mailing list
Xournal-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xournal-devel