summaryrefslogtreecommitdiff
path: root/tikzit/src/linux/PreambleEditor.m
diff options
context:
space:
mode:
authorrandomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-01-10 18:27:19 +0000
committerrandomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-01-10 18:27:19 +0000
commit924aad8f38e277547b104977dd48ef2be7c702f8 (patch)
treeb7c731f461c3dcad3ea87b79e8e916a8387c7dfa /tikzit/src/linux/PreambleEditor.m
parente77f7c4f027d9fefb609bef3c97df9b8ff0c2a31 (diff)
GTK: Allow the path to pdflatex to be configured
git-svn-id: https://tikzit.svn.sourceforge.net/svnroot/tikzit/trunk@377 7c02a99a-9b00-45e3-bf44-6f3dd7fddb64
Diffstat (limited to 'tikzit/src/linux/PreambleEditor.m')
-rw-r--r--tikzit/src/linux/PreambleEditor.m35
1 files changed, 22 insertions, 13 deletions
diff --git a/tikzit/src/linux/PreambleEditor.m b/tikzit/src/linux/PreambleEditor.m
index 82880c7..7b299c3 100644
--- a/tikzit/src/linux/PreambleEditor.m
+++ b/tikzit/src/linux/PreambleEditor.m
@@ -101,10 +101,17 @@ static void preamble_selection_changed_cb (GtkTreeSelection *treeselection,
}
- (void) setParentWindow:(GtkWindow*)parent {
- parentWindow = parent;
- if (window) {
- gtk_window_set_transient_for (window, parentWindow);
- }
+ GtkWindow *oldParent = parentWindow;
+
+ if (parent)
+ g_object_ref (parentWindow);
+ parentWindow = parent;
+ if (oldParent)
+ g_object_unref (oldParent);
+
+ if (window) {
+ gtk_window_set_transient_for (window, parentWindow);
+ }
}
- (void) show {
@@ -141,8 +148,13 @@ static void preamble_selection_changed_cb (GtkTreeSelection *treeselection,
- (void) dealloc {
[preambles release];
preambles = nil;
- gtk_widget_destroy (GTK_WIDGET (window));
- window = NULL;
+ if (window) {
+ gtk_widget_destroy (GTK_WIDGET (window));
+ window = NULL;
+ }
+ if (parentWindow) {
+ g_object_ref (parentWindow);
+ }
[super dealloc];
}
@@ -220,9 +232,8 @@ static void preamble_selection_changed_cb (GtkTreeSelection *treeselection,
G_CALLBACK (window_focus_out_event_cb),
self);
- GtkWidget *mainBox = gtk_vbox_new (FALSE, 0);
+ GtkWidget *mainBox = gtk_vbox_new (FALSE, 18);
gtk_container_set_border_width (GTK_CONTAINER (mainBox), 12);
- gtk_box_set_spacing (GTK_BOX (mainBox), 18);
gtk_container_add (GTK_CONTAINER (window), mainBox);
GtkPaned *paned = GTK_PANED (gtk_hpaned_new ());
@@ -234,12 +245,10 @@ static void preamble_selection_changed_cb (GtkTreeSelection *treeselection,
GtkWidget *listFrame = gtk_frame_new (NULL);
gtk_container_add (GTK_CONTAINER (listFrame), listWidget);
- GtkBox *listBox = GTK_BOX (gtk_vbox_new (FALSE, 0));
- gtk_box_set_spacing (listBox, 6);
+ GtkBox *listBox = GTK_BOX (gtk_vbox_new (FALSE, 6));
gtk_box_pack_start (listBox, listFrame, TRUE, TRUE, 0);
- GtkContainer *listButtonBox = GTK_CONTAINER (gtk_hbox_new (FALSE, 0));
- gtk_box_set_spacing (GTK_BOX (listButtonBox), 6);
+ GtkContainer *listButtonBox = GTK_CONTAINER (gtk_hbox_new (FALSE, 6));
gtk_box_pack_start (listBox, GTK_WIDGET (listButtonBox), FALSE, TRUE, 0);
GtkWidget *addButton = gtk_button_new_from_stock (GTK_STOCK_ADD);
g_signal_connect (addButton,
@@ -544,4 +553,4 @@ static void preamble_selection_changed_cb (GtkTreeSelection *treeselection,
// }}}
-// vim:ft=objc:ts=4:noet:sts=4:sw=4:foldmethod=marker
+// vim:ft=objc:ts=4:et:sts=4:sw=4:foldmethod=marker