Search Results

Search found 473 results on 19 pages for 'karma runner'.

Page 6/19 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • How do I run gtk demos?

    - by Runner
    They are located under: share\gtk-2.0\demo But none of them contains a main function, how can I make the following textscroll.c actually work: /* Text Widget/Automatic scrolling * * This example demonstrates how to use the gravity of * GtkTextMarks to keep a text view scrolled to the bottom * while appending text. */ #include <gtk/gtk.h> #include "demo-common.h" /* Scroll to the end of the buffer. */ static gboolean scroll_to_end (GtkTextView *textview) { GtkTextBuffer *buffer; GtkTextIter iter; GtkTextMark *mark; char *spaces; static int count; buffer = gtk_text_view_get_buffer (textview); /* Get "end" mark. It's located at the end of buffer because * of right gravity */ mark = gtk_text_buffer_get_mark (buffer, "end"); gtk_text_buffer_get_iter_at_mark (buffer, &iter, mark); /* and insert some text at its position, the iter will be * revalidated after insertion to point to the end of inserted text */ spaces = g_strnfill (count++, ' '); gtk_text_buffer_insert (buffer, &iter, "\n", -1); gtk_text_buffer_insert (buffer, &iter, spaces, -1); gtk_text_buffer_insert (buffer, &iter, "Scroll to end scroll to end scroll " "to end scroll to end ", -1); g_free (spaces); /* Now scroll the end mark onscreen. */ gtk_text_view_scroll_mark_onscreen (textview, mark); /* Emulate typewriter behavior, shift to the left if we * are far enough to the right. */ if (count > 150) count = 0; return TRUE; } /* Scroll to the bottom of the buffer. */ static gboolean scroll_to_bottom (GtkTextView *textview) { GtkTextBuffer *buffer; GtkTextIter iter; GtkTextMark *mark; char *spaces; static int count; buffer = gtk_text_view_get_buffer (textview); /* Get end iterator */ gtk_text_buffer_get_end_iter (buffer, &iter); /* and insert some text at it, the iter will be revalidated * after insertion to point to the end of inserted text */ spaces = g_strnfill (count++, ' '); gtk_text_buffer_insert (buffer, &iter, "\n", -1); gtk_text_buffer_insert (buffer, &iter, spaces, -1); gtk_text_buffer_insert (buffer, &iter, "Scroll to bottom scroll to bottom scroll " "to bottom scroll to bottom", -1); g_free (spaces); /* Move the iterator to the beginning of line, so we don't scroll * in horizontal direction */ gtk_text_iter_set_line_offset (&iter, 0); /* and place the mark at iter. the mark will stay there after we * insert some text at the end because it has right gravity. */ mark = gtk_text_buffer_get_mark (buffer, "scroll"); gtk_text_buffer_move_mark (buffer, mark, &iter); /* Scroll the mark onscreen. */ gtk_text_view_scroll_mark_onscreen (textview, mark); /* Shift text back if we got enough to the right. */ if (count > 40) count = 0; return TRUE; } static guint setup_scroll (GtkTextView *textview, gboolean to_end) { GtkTextBuffer *buffer; GtkTextIter iter; buffer = gtk_text_view_get_buffer (textview); gtk_text_buffer_get_end_iter (buffer, &iter); if (to_end) { /* If we want to scroll to the end, including horizontal scrolling, * then we just create a mark with right gravity at the end of the * buffer. It will stay at the end unless explicitely moved with * gtk_text_buffer_move_mark. */ gtk_text_buffer_create_mark (buffer, "end", &iter, FALSE); /* Add scrolling timeout. */ return g_timeout_add (50, (GSourceFunc) scroll_to_end, textview); } else { /* If we want to scroll to the bottom, but not scroll horizontally, * then an end mark won't do the job. Just create a mark so we can * use it with gtk_text_view_scroll_mark_onscreen, we'll position it * explicitely when needed. Use left gravity so the mark stays where * we put it after inserting new text. */ gtk_text_buffer_create_mark (buffer, "scroll", &iter, TRUE); /* Add scrolling timeout. */ return g_timeout_add (100, (GSourceFunc) scroll_to_bottom, textview); } } static void remove_timeout (GtkWidget *window, gpointer timeout) { g_source_remove (GPOINTER_TO_UINT (timeout)); } static void create_text_view (GtkWidget *hbox, gboolean to_end) { GtkWidget *swindow; GtkWidget *textview; guint timeout; swindow = gtk_scrolled_window_new (NULL, NULL); gtk_box_pack_start (GTK_BOX (hbox), swindow, TRUE, TRUE, 0); textview = gtk_text_view_new (); gtk_container_add (GTK_CONTAINER (swindow), textview); timeout = setup_scroll (GTK_TEXT_VIEW (textview), to_end); /* Remove the timeout in destroy handler, so we don't try to * scroll destroyed widget. */ g_signal_connect (textview, "destroy", G_CALLBACK (remove_timeout), GUINT_TO_POINTER (timeout)); } GtkWidget * do_textscroll (GtkWidget *do_widget) { static GtkWidget *window = NULL; if (!window) { GtkWidget *hbox; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); gtk_window_set_default_size (GTK_WINDOW (window), 600, 400); hbox = gtk_hbox_new (TRUE, 6); gtk_container_add (GTK_CONTAINER (window), hbox); create_text_view (hbox, TRUE); create_text_view (hbox, FALSE); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else gtk_widget_destroy (window); return window; }

    Read the article

  • How do I retrieve the values entered in a nested control added dynamically to a webform?

    - by Front Runner
    I have a date range user control with two calendar controls: DateRange.ascx public partial class DateRange { public string FromDate { get { return calFromDate.Text; } set { calFromDate.Text = value; } } public string ToDate { get { return calToDate.Date; } set { calToDate.Text = value; } } } I have another user control in which DateRange control is loaded dynamically: ParamViewer.ascx public partial class ParamViewer { public void Setup(string sControlName) { //Load parameter control Control control = LoadControl("DateRange.ascx"); Controls.Add(control); DateRange dteFrom = (DateRange)control.FindControl("calFromDate"); DateRange dteTo = (DateRange)control.FindControl("calToDate"); } } I have a main page webForm1.aspx where ParamViewer.ascx is added When user enter the dates, they're set correctly in DateRange control. My question is how how do I retrieve the values entered in DateRange (FromDate and ToDate)control from btnSubmit_Click event in webForm1? Please advise. Thank you in advance.

    Read the article

  • Is there an example for mark with right gravit?

    - by Runner
    Quoted from here: The standard left-to-right cursor is a mark with right gravity (when you type, the cursor stays on the right side of the text you're typing). Now I see what's an mark with right gravity. But I still don't have an idea what's a mark with left gravity like,is there an example of left gravity mark?

    Read the article

  • How do I make the gtk code work?

    - by Runner
    vbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(window), vbox); ... frame = gtk_fixed_new(); gtk_container_add(GTK_CONTAINER(window), frame); ... The above code will generate the warning below: Gtk-WARNING **: Attempting to add a widget with type GtkFixed to a GtkWindow, but as a GtkBin subclass a GtkWindow can only contain one widget at a time; it already contains a widget of type GtkVBox Which results in frame is not shown in the window. How can I make both vbox and frame show?

    Read the article

  • What's the equivalent of gcc's -mwindows option in cmake?

    - by Runner
    I'm following the tuto: http://zetcode.com/tutorials/gtktutorial/firstprograms/ It works but each time I double click on the executable,there is a console which I don't want it there. How do I get rid of that console? I tried this: add_executable(Cmd WIN32 cmd.c) But got this fatal error: MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup Cmd.exe : fatal error LNK1120: 1 unresolved externals While using gcc directly works: gcc -o Cmd cmd.c -mwindows .. I'm guessing it has something to do with the entry function: int main( int argc, char *argv[]),but why gcc works? How can I make it work with cmake? UPDATE Let me paste the source code here for convenience: #include <gtk/gtk.h> int main( int argc, char *argv[]) { GtkWidget *window; gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_show(window); gtk_main(); return 0; } UPDATE2 Why gcc -mwindows works but add_executable(Cmd WIN32 cmd.c) not? Maybe that's not the equivalent for -mwindows in cmake?

    Read the article

  • How can I make XOR work for logical matrix in MATLAB?

    - by Runner
    >> XOR(X,X) ??? Undefined function or method 'XOR' for input arguments of type 'logical'. Why XOR can't be used for logical matrix? And I tried a more simple example: >> A=[1 0;1 0]; >> B=[1 1;0 0]; >> XOR(A,B) ??? Undefined function or method 'XOR' for input arguments of type 'double'. How can I properly use XOR?

    Read the article

  • How do I understand what the following means?

    - by Runner
    Quoted from here: if (to_end) { /* If we want to scroll to the end, including horizontal scrolling, * then we just create a mark with right gravity at the end of the * buffer. It will stay at the end unless explicitely moved with * gtk_text_buffer_move_mark. */ gtk_text_buffer_create_mark (buffer, "end", &iter, FALSE); /* Add scrolling timeout. */ return g_timeout_add (50, (GSourceFunc) scroll_to_end, textview); } else { /* If we want to scroll to the bottom, but not scroll horizontally, * then an end mark won't do the job. Just create a mark so we can * use it with gtk_text_view_scroll_mark_onscreen, we'll position it * explicitely when needed. Use left gravity so the mark stays where * we put it after inserting new text. */ gtk_text_buffer_create_mark (buffer, "scroll", &iter, TRUE); /* Add scrolling timeout. */ return g_timeout_add (100, (GSourceFunc) scroll_to_bottom, textview); } Though there are quite a few lines of comments, I still don't understand the logic in it,especially, what's the relation between an mark and the position of scroll bar?

    Read the article

  • Infinite gtk warnings when I right click on the icon --CLOSED

    - by Runner
    From this tuto: #include <gtk/gtk.h> int main( int argc, char *argv[]) { GtkWidget *window; gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_show(window); gtk_main(); return 0; } I run the executable and right click on the icon,then infinite warnings(the same) reported: GLib-WARNING **: g_main_context_check() called recursively from within a source's check() or prepare() member. Anyone knows how to fix this warning? UPDATE This problem also exists with gtk-demo , is it a gtk bug? Can someone verify that? Platform: windows XP UPDATE AGAIN This is indeed a gtk bug,which is un-fixable.

    Read the article

  • How does PATH environment affect my running executable from using msvcr90 to msvcr80 ???

    - by Runner
    #include <gtk/gtk.h> int main( int argc, char *argv[] ) { GtkWidget *window; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_show (window); gtk_main (); return 0; } I tried putting various versions of MSVCR80.dll under the same directory as the generated executable(via cmake),but none matched. Is there a general solution for this kinda problem? UPDATE Some answers recommend install the VS redist,but I'm not sure whether or not it will affect my installed Visual Studio 9, can someone confirm? Manifest file of the executable <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <security> <requestedPrivileges> <requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel> </requestedPrivileges> </security> </trustInfo> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity> </dependentAssembly> </dependency> </assembly> It seems the manifest file says it should use the MSVCR90, why it always reporting missing MSVCR80.dll? FOUND After spending several hours on it,finally I found it's caused by this setting in PATH: D:\MATLAB\R2007b\bin\win32 After removing it all works fine.But why can that setting affect my running executable from using msvcr90 to msvcr80 ???

    Read the article

  • Which is the correct way to use PDO in PHP?

    - by Runner
    One from here: $sth->execute(array(':calories' => $calories, ':colour' => $colour)); The other from here: /*** reassign the variables again ***/ $data = array('animal_id'=>4, 'animal_name' => 'bruce'); /*** execute the prepared statement ***/ $stmt->execute($data); My question is: :key or key ? Sorry I don't have the PHP environment here.

    Read the article

  • How to poll the popular websites in PHP?

    - by Runner
    It's springed from this answer: http://superuser.com/questions/129741/how-does-search-engines-update-indexing-so-soon/129743#129743 BTW,for the servers that's polled,is it the same whether the request is just for polling(header information) or complete web page?

    Read the article

  • A think on sum(X, 1)

    - by Runner
    >> X = [0 1 2 3 4 5] >> sum(X, 1) ans = 3 5 7 sum(X, 1) should sum along the 1st dimension(row) as per the document says: S = SUM(X,DIM) sums along the dimension DIM. But why does it actually sums along the 2nd dimension(column)?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >