Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
karudu
/
C-editor
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Snippets
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
40571030
authored
Mar 04, 2022
by
karudu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Uue faili loomine
parent
d0313963
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
ceditor.c
ceditor.c
View file @
40571030
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
#endif
#endif
/* TODO
/* TODO
Uus fail, n
imeta salvestamine
N
imeta salvestamine
Scrollbar
Scrollbar
*/
*/
...
@@ -37,6 +37,18 @@ void TekstMarkSet(GtkTextBuffer *Puhver, const GtkTextIter *new_location, GtkTex
...
@@ -37,6 +37,18 @@ void TekstMarkSet(GtkTextBuffer *Puhver, const GtkTextIter *new_location, GtkTex
UuendaRidaVeerg
(
Puhver
,
GTK_STATUSBAR
(
Data
));
UuendaRidaVeerg
(
Puhver
,
GTK_STATUSBAR
(
Data
));
}
}
void
UusFail
(
GtkWidget
*
Nupp
,
gpointer
Data
)
{
GtkTextBuffer
*
Puhver
=
GTK_TEXT_BUFFER
(
Data
);
GtkTextIter
TekstA
,
TekstL
;
gtk_text_buffer_get_start_iter
(
Puhver
,
&
TekstA
);
gtk_text_buffer_get_end_iter
(
Puhver
,
&
TekstL
);
gtk_text_buffer_delete
(
Puhver
,
&
TekstA
,
&
TekstL
);
gtk_text_buffer_set_modified
(
Puhver
,
FALSE
);
}
void
AvaFail
(
GtkWidget
*
Nupp
,
gpointer
Data
)
void
AvaFail
(
GtkWidget
*
Nupp
,
gpointer
Data
)
{
{
GtkTextBuffer
*
Puhver
=
GTK_TEXT_BUFFER
(
Data
);
GtkTextBuffer
*
Puhver
=
GTK_TEXT_BUFFER
(
Data
);
...
@@ -78,11 +90,12 @@ void SalvestaFail(GtkWidget *Nupp, gpointer Data)
...
@@ -78,11 +90,12 @@ void SalvestaFail(GtkWidget *Nupp, gpointer Data)
if
(
Vastus
==
GTK_RESPONSE_ACCEPT
)
if
(
Vastus
==
GTK_RESPONSE_ACCEPT
)
{
{
char
*
Nimi
=
gtk_file_chooser_get_filename
(
GTK_FILE_CHOOSER
(
Dialog
));
char
*
Nimi
=
gtk_file_chooser_get_filename
(
GTK_FILE_CHOOSER
(
Dialog
));
gchar
*
Sisu
;
GtkTextIter
TekstA
,
TekstL
;
GtkTextIter
TekstA
,
TekstL
;
gtk_text_buffer_get_start_iter
(
Puhver
,
&
TekstA
);
gtk_text_buffer_get_start_iter
(
Puhver
,
&
TekstA
);
gtk_text_buffer_get_end_iter
(
Puhver
,
&
TekstL
);
gtk_text_buffer_get_end_iter
(
Puhver
,
&
TekstL
);
Sisu
=
gtk_text_buffer_get_text
(
Puhver
,
&
TekstA
,
&
TekstL
,
TRUE
);
gchar
*
Sisu
=
gtk_text_buffer_get_text
(
Puhver
,
&
TekstA
,
&
TekstL
,
TRUE
);
gtk_text_buffer_set_modified
(
Puhver
,
FALSE
);
gtk_text_buffer_set_modified
(
Puhver
,
FALSE
);
GError
*
Viga
=
NULL
;
GError
*
Viga
=
NULL
;
...
@@ -93,6 +106,7 @@ void SalvestaFail(GtkWidget *Nupp, gpointer Data)
...
@@ -93,6 +106,7 @@ void SalvestaFail(GtkWidget *Nupp, gpointer Data)
}
}
g_free
(
Nimi
);
g_free
(
Nimi
);
g_free
(
Sisu
);
g_free
(
Sisu
);
}
}
gtk_widget_destroy
(
Dialog
);
gtk_widget_destroy
(
Dialog
);
}
}
...
@@ -140,6 +154,7 @@ int main(int argc, char **argv)
...
@@ -140,6 +154,7 @@ int main(int argc, char **argv)
gtk_menu_item_set_submenu
(
GTK_MENU_ITEM
(
FailMenuNupp
),
FailMenu
);
gtk_menu_item_set_submenu
(
GTK_MENU_ITEM
(
FailMenuNupp
),
FailMenu
);
// Fail menüü
// Fail menüü
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
FailMenu
),
FailMenuUus
);
// Fail->Uus
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
FailMenu
),
FailMenuUus
);
// Fail->Uus
g_signal_connect
(
FailMenuUus
,
"activate"
,
G_CALLBACK
(
UusFail
),
Puhver
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
FailMenu
),
FailMenuAva
);
// Fail->Ava
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
FailMenu
),
FailMenuAva
);
// Fail->Ava
g_signal_connect
(
FailMenuAva
,
"activate"
,
G_CALLBACK
(
AvaFail
),
Puhver
);
g_signal_connect
(
FailMenuAva
,
"activate"
,
G_CALLBACK
(
AvaFail
),
Puhver
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
FailMenu
),
FailMenuSalvesta
);
// Fail->Salvesta
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
FailMenu
),
FailMenuSalvesta
);
// Fail->Salvesta
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment