[Nemiver-list] sourceview markers question



Dodji,
I sent an email the the gtksourceviewmm list on a related topic, but I
thought I'd ask for advice / clarification on how sourceview markers
are used in nemiver (and in general, as I've not done much sourceview
programming yet (or textview for that matter)).  As far as I can tell,
you can register a 'type' of marker and associate it with a pixbuf.
Then you can create markers of this type and associate them with
different lines.  And each of these markers can also have a name.

As far as I can tell, for breakpoints, nemiver uses the line number
for the name and the type of marker.  For instance:

   UString marker_name = UString::from_int (a_line);
   m_priv->register_breakpoint_marker_name (marker_name) ;
   Glib::RefPtr<gtksourceview::SourceMarker> marker =
       source_view ().get_source_buffer ()->create_marker
           (marker_name, marker_name, iter) ;

So, if I'm understanding correctly, if we have breakpoints on lines
23, 56, and 358, we would do the following:
-  register a marker type of '23' and associate it with the breakpoint icon.
- create a marker named '23' with type '23' at the given line
-  register a marker type of '56' and associate it with the breakpoint icon.
- create a marker named '56' with type '56' at the given line
-  register a marker type of '358' and associate it with the breakpoint icon.
- create a marker named '358' with type '358' at the given line

My question is: why do we register a marker type for each line number?
Why wouldn't we just register a single type "breakpoint" and create
all markers with this type?  The reason I ask is that I'm working on
enabling/disabling breakpoints, so I want to be able to switch the
marker icon to a disabled breakpoint icon.  It seems that this would
be easier if we just had a "breakpoint" type and a
"disabled-breakpoint" type, but maybe I don't understand the
sourcemarker stuff well enough yet...  Any advice?

--
jonner




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