[tomboy-list] checkboxes for todos
Sandy Armstrong
sanfordarmstrong at gmail.com
Wed Sep 23 14:05:14 PDT 2009
This is something that interests me. No time to hack right now, but
attached is an updated version of Max's patch that applies in latest
git master.
Also attached is a screenshot of how it looks right now, so you can
see that some hackery is still need to make it look decent. If anyone
is interested in working on this, that would rock.
Sandy
On Wed, Sep 26, 2007 at 1:25 PM, Max Wiehle <wiehle at l3s.de> wrote:
> Hi,
>
> I just had a very quick try at this. It's not even a proof of concept.
> So don't expect any magic or anything. I just tried to get a checkbox
> printed at the beginning of the line since i am not familiar with
> neither tomboy nor gtk or TextView details.
>
> I did not care about where in the addin this would go either. I just
> hacked it right into the core of tomboy.
>
> I attached a patch that won't do anything usefull but convert [] at the
> beginning of a line in checkboxes. They don't get stored either.
>
> Am Mittwoch, denf 26.09.2007, 09:00 -0600 schrieb Boyd Timothy:
>> Well, I don't know that I saved any of that code anywhere. Basically,
>> here are some of the issues I ran into:
>>
>> 1. Modifying the TextBuffer during a TextBuffer.InsertText event
>> (i.e., to add a checkbox) can be very tricky. The problem happens if
>> there are other listeners for this event which follow. If you change
>> the TextIter at all during this process, it can cause some real
>> problems for the following event listeners. Supposedly, you're
>> supposed to be able to correct the TextIter before exiting your event
>> handler, but I haven't figure out the right calls to do that in C#.
> I think reformating the line after finishing it, just the way
> bulletlists do migth reduce some of that trouble. I don't know how this
> would fit into Addins though but the Latex Addin seems to take a similar
> approach.
>
>> 2. The calls to insert at Widget into a ChildAnchor come from the
>> TextView (the UI). During the event handler, you're not dealing with
>> the UI at all and strictly the TextBuffer. I wasn't able to figure
>> out how to get a Widget (like a CheckButton) to get inserted during
>> the event handler.
> I tried this by just adding the anchor and then triggering an event that
> gets handled in the UI and adds the actual widget.
>
>> 3. Another option was trying to use a Gdk.Pixbuf. TextBuffer allows
>> you to insert a Gdk.Pixbuf at a TextIter. This is how Tomboy's
>> Bugzilla Addin works (see the bugzilla addin code for details). I
>> tried going down this route as well, but there are problems doing it
>> this way too: a) you now have to match the theme with a properly drawn
>> checkbox, b) you have to figure out how to capture mouse button clicks
>> so the user can mark the checkbox, c) you've got to figure out how to
>> change the empty box to a box with a check when the user clicks the
>> box.
> I'd prefer a way to insert widgets since that might proof useful later
> on.
>
>> 4. To complicate things even a bit more, since we need unique IDs/Uris
>> to each separate tasks, you can't just use a standard TextTag to mark
>> the todo text as a todo. You have to use anonymous TextTags (I
>> believe the Gtk C API discusses this). So, you have to set up your
>> own data structures to keep track of the TextTags and TextIters. You
>> can't just use the TextTagTable or other methods available from the
>> TextBuffer to deal with the TextTags.
> That's what was puzzling me in the end. What data structures to use, How
> to "store the checkbox" and do the parsing etc.
>
>> In any case, if you'd like to take a stab at it, that would be
>> awesome! Maybe I was trying to use the TextBuffer completely wrong?
>> Perhaps you're a Gtk TextView/TextBuffer expert? If not, maybe your
>> luck will be better than mine and that would ROCK!
> As might be quite obvious i am not an expert at all ;) Might keep trying
> my luck though.
>
> Max
>
>> -Boyd
>>
>> On 9/26/07, Max Wiehle <wiehle at l3s.de> wrote:
>> > Hey Boyd,
>> >
>> > You said during the meeting you tried to get checkboxes for todo items
>> > working. I was thinking about giving it a try as well. Just don't want
>> > to run into the same problems again.
>> > I guess you used child anchors of the TextView widget?
>> >
>> > Could you describe your problems or maybe send me your code?
>> >
>> > Thanks,
>> > Max
>> >
>> > Am Montag, den 24.09.2007, 08:41 -0600 schrieb Boyd Timothy:
>> > > Everyone's invited to attend the Tomboy Planning Meeting tomorrow:
>> > >
>> > > Who: Everyone who'd like to participate
>> > > Where: #tomboy on irc.gnome.org
>> > > When: Tuesday, 25 September 2007, 13:00 PST
>> > > What: http://live.gnome.org/Tomboy/DevMeetingZeroPointTen
>> > > _______________________________________________
>> > > Tomboy-list mailing list
>> > > Tomboy-list at lists.beatniksoftware.com
>> > > http://lists.beatniksoftware.com/listinfo.cgi/tomboy-list-beatniksoftware.com
>> >
>> >
>
> _______________________________________________
> Tomboy-list mailing list
> Tomboy-list at lists.beatniksoftware.com
> http://lists.beatniksoftware.com/listinfo.cgi/tomboy-list-beatniksoftware.com
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: checkbox2.patch
Type: text/x-diff
Size: 3460 bytes
Desc: not available
URL: <http://lists.beatniksoftware.com/pipermail/tomboy-list-beatniksoftware.com/attachments/20090923/9e657cdd/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: checkboxes.png
Type: image/png
Size: 11642 bytes
Desc: not available
URL: <http://lists.beatniksoftware.com/pipermail/tomboy-list-beatniksoftware.com/attachments/20090923/9e657cdd/attachment.png>
More information about the Tomboy-list
mailing list