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
3b41b73f
authored
Mar 15, 2022
by
castro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update main.c
parent
93ace83c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
main.c → search.c
main
.c
→
search
.c
View file @
3b41b73f
...
...
@@ -15,19 +15,19 @@
#define PEALKIRI "CEditor TextView"
#endif
// Uuenda nidatud rida ja veergu kursori asukoha jrgi
// Uuenda nidatud rida ja veergu kursori asukoha jrgi
void
UuendaRidaVeerg
(
GtkTextBuffer
*
Puhver
,
GtkStatusbar
*
StatusBar
)
{
GtkTextIter
Iter
;
// Leia kursori asukoht
gtk_text_buffer_get_iter_at_mark
(
Puhver
,
&
Iter
,
gtk_text_buffer_get_insert
(
Puhver
));
// Vta selle rida ja veerg
// Vta selle rida ja veerg
gint
Rida
=
gtk_text_iter_get_line
(
&
Iter
);
gint
Veerg
=
gtk_text_iter_get_line_offset
(
&
Iter
);
gtk_statusbar_pop
(
StatusBar
,
0
);
// Vta eelmine tekst ra
gtk_statusbar_pop
(
StatusBar
,
0
);
// Vta eelmine tekst ra
gchar
*
Tekst
=
g_strdup_printf
(
"%d:%d"
,
Rida
+
1
,
Veerg
+
1
);
// Loo string rea ja veeruga
gtk_statusbar_push
(
StatusBar
,
0
,
Tekst
);
// Nita teksti
gtk_statusbar_push
(
StatusBar
,
0
,
Tekst
);
// Nita teksti
g_free
(
Tekst
);
}
...
...
@@ -58,30 +58,30 @@ int main(int argc, char **argv)
GtkWidget
*
MenuBar
=
gtk_menu_bar_new
();
// Loo menu bar
GtkWidget
*
FailMenuNupp
=
gtk_menu_item_new_with_label
(
"Fail"
);
// Fail
GtkWidget
*
AboutMenuNupp
=
gtk_menu_item_new_with_label
(
"About"
);
// About
GtkWidget
*
FailMenu
=
gtk_menu_new
();
// Fail men
GtkWidget
*
FailMenu
=
gtk_menu_new
();
// Fail men
GtkWidget
*
FailMenuUus
=
gtk_menu_item_new_with_label
(
"Uus"
);
// Fail->Uus
GtkWidget
*
FailMenuAva
=
gtk_menu_item_new_with_label
(
"Ava"
);
// Fail->Ava
GtkWidget
*
FailMenuSalvesta
=
gtk_menu_item_new_with_label
(
"Salvesta"
);
// Fail->Salvesta
GtkWidget
*
FailMenuSalvestaN
=
gtk_menu_item_new_with_label
(
"Salvesta nimega"
);
// Fail->Salvesta nimega
GtkWidget
*
FailMenuValju
=
gtk_menu_item_new_with_label
(
"Vlju"
);
// Fail->Vlju
GtkWidget
*
FailMenuValju
=
gtk_menu_item_new_with_label
(
"Vlju"
);
// Fail->Vlju
// Search
GtkWidget
*
search_nupp
=
gtk_menu_item_new_with_label
(
"Otsi"
);
GtkWidget
*
search_aken
;
// Men nupud menu bar'i
// Men nupud menu bar'i
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
MenuBar
),
FailMenuNupp
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
MenuBar
),
AboutMenuNupp
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
MenuBar
),
search_nupp
);
// Mend nuppudesse
// Mend nuppudesse
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
),
FailMenuAva
);
// Fail->Ava
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
FailMenu
),
FailMenuSalvesta
);
// Fail->Salvesta
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
FailMenu
),
FailMenuSalvestaN
);
// Fail->Salvesta nimega
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
FailMenu
),
gtk_separator_menu_item_new
());
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
FailMenu
),
FailMenuValju
);
// Fail->Vlju
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
FailMenu
),
FailMenuValju
);
// Fail->Vlju
g_signal_connect
(
G_OBJECT
(
FailMenuValju
),
"activate"
,
G_CALLBACK
(
gtk_main_quit
),
NULL
);
// Search
...
...
@@ -113,7 +113,7 @@ int main(int argc, char **argv)
// Copy/paste lohistamise callback, uuendab samuti
g_signal_connect_object
(
Puhver
,
"mark_set"
,
G_CALLBACK
(
TekstMarkSet
),
StatusBar
,
0
);
gtk_widget_show_all
(
Aken
);
// Nita akent
gtk_widget_show_all
(
Aken
);
// Nita akent
UuendaRidaVeerg
(
Puhver
,
GTK_STATUSBAR
(
StatusBar
));
// Esimene uuendus
gtk_main
();
...
...
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