beaver-devel
[Top][All Lists]
Advanced

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

Re: [Beaver-devel] Ascii art plugin


From: t.heinzen
Subject: Re: [Beaver-devel] Ascii art plugin
Date: Sun, 21 Sep 2008 16:43:25 +0200

Um Sun, 21 Sep 2008 14:22:08 +0200
 schrieb Double 12 <address@hidden>:
> I made a start on the actual drawing of the Ascii Art
> plugin. I need to  split the gchar* of the whole word in
> seperate characters? I know this is a basic C skill, but
> how can i do that? g_str_split doesn't seem suitable for
> this, it uses a delimiter.
> Look at the ascii.c code. The shapre of the arts is
> hardcoded in the code. This is the best option I could
> find. Or is it better to add the shape of the letters to
> a struct?

well a gchar* is a pointer to an array of gchar's. So you
can easily obtain every single letter. for example if you
got 

gchar* word = "test"

then you can acces the first letter via word[0], the second
word[1] and so on. every "string" is so called zero ended.
meaning the last character is 0 on every string. so you can
iterate over the string via:

gchar* word = "test";
gchar* next = word;
while (*next) {
    printf ("%c\n", *next);
    next++;
}

> 
> Although printing documents in Beaver isn't used a lot,
> it would be a lot better to use a GtkPrintUnixDialog to
> select a printer and printer settings and then construct
> a GtkPrintJob.
>
http://library.gnome.org/devel/gtk/unstable/GtkPrintUnixDialog.html
> If you're okay with that, I'll try to make such a dialog.

I agree with you 100%. I already tried to do so, but the
GtkPrintUnixDialog wasn't avaiable in my version of
gtk+-2.0 yet and I do not want to install unstable gtk
versions on my computer so I couldn't try this further.
Also it would not be wise to do this as long
gtkprintunixdialog is unstable. 

There's another way to do printing. the GtkPrintOperation

http://library.gnome.org/devel/gtk/stable/gtk-High-level-Printing-API.html

is a powerful API that let's you do printing. I didn't
understand it fully, and it's not that easy I think. If you
want to try go ahead (I tried it myself but I think I was
too stupid for it, or it is just too complicated ^^)

> 
> The function print_msg (used to print things on the
> message bar) may also be used by plugin writers. Shall I
> move it to the API? Or is the whole message bar an
> obsolete idea?
>

Well I don't know if it's obsolete. The messagebar is cool
for displaying on which line you are etc... but for other
things i'm not sure. for example: if you open certain
dialogs there's a message in the messagebar (which is
pretty much useless since the dialog is open and you see it
^^). for other things it might be usefull (like when you do
auto-completion, it tells you when no auto-completion is
possible).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]